00:06:46 -!- honkfestival [~honkfesti@198-84-183-94.cpe.teksavvy.com] has quit [Quit: Computer has gone to sleep.] 00:08:57 honkfestival [~honkfesti@198-84-183-94.cpe.teksavvy.com] has joined #scheme 00:15:02 dnolen [~user@cpe-74-64-61-245.nyc.res.rr.com] has joined #scheme 00:22:32 -!- honkfestival [~honkfesti@198-84-183-94.cpe.teksavvy.com] has quit [Quit: Computer has gone to sleep.] 00:27:54 -!- hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has quit [Ping timeout: 252 seconds] 00:29:40 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 00:29:45 honkfestival [~honkfesti@198-84-183-94.cpe.teksavvy.com] has joined #scheme 00:51:50 -!- dnolen [~user@cpe-74-64-61-245.nyc.res.rr.com] has quit [Ping timeout: 244 seconds] 00:53:10 safekeeping [~safekeepi@c-68-36-167-104.hsd1.nj.comcast.net] has joined #scheme 00:53:47 -!- kk` [~kk@unaffiliated/kk/x-5380134] has quit [Ping timeout: 255 seconds] 00:55:42 -!- ase [~se@ip56583baa.direct-adsl.nl] has quit [Remote host closed the connection] 01:07:52 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Quit: Leaving] 01:21:11 -!- acarrico [~acarrico@pppoe-68-142-36-178.gmavt.net] has quit [Ping timeout: 252 seconds] 01:32:52 -!- PuercoPop [~user@190.222.252.106] has quit [Ping timeout: 256 seconds] 01:38:17 acarrico [~acarrico@pppoe-68-142-36-178.gmavt.net] has joined #scheme 01:44:49 Tau [~Euler@186.194.51.6] has joined #scheme 01:58:35 snits [~snits@inet-hqmc06-o.oracle.com] has joined #scheme 02:00:02 -!- toekutr [~user@50-0-51-11.dsl.static.sonic.net] has quit [Remote host closed the connection] 02:10:50 -!- Tau [~Euler@186.194.51.6] has quit [Ping timeout: 246 seconds] 02:14:49 b4283 [~b4283@60-249-196-111.HINET-IP.hinet.net] has joined #scheme 02:29:13 -!- jrapdx [~jra@74-95-41-205-Oregon.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 02:34:15 ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has joined #scheme 02:41:13 robot-beethoven [~user@c-24-118-142-0.hsd1.mn.comcast.net] has joined #scheme 02:48:01 -!- ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has quit [Ping timeout: 248 seconds] 02:52:01 amoe_ [~amoe@host-78-147-163-176.as13285.net] has joined #scheme 02:55:31 -!- amoe [~amoe@host-78-147-96-151.as13285.net] has quit [Ping timeout: 260 seconds] 02:56:20 -!- cdidd [~cdidd@95-28-64-7.broadband.corbina.ru] has quit [Ping timeout: 248 seconds] 02:59:58 Tau [~Euler@186-194-45-142.i-next.psi.br] has joined #scheme 03:00:04 hey. 03:00:08 i showed a code earlier. 03:00:12 but my connection went down. 03:00:19 did one of you send some feedback? 03:07:45 jrapdx [~jra@c-76-115-235-187.hsd1.wa.comcast.net] has joined #scheme 03:08:49 -!- copumpkin [~copumpkin@unaffiliated/copumpkin] has quit [Ping timeout: 248 seconds] 03:09:18 copumpkin [~copumpkin@unaffiliated/copumpkin] has joined #scheme 03:11:05 cdidd [~cdidd@95-26-150-61.broadband.corbina.ru] has joined #scheme 03:11:51 -!- Tau [~Euler@186-194-45-142.i-next.psi.br] has quit [Ping timeout: 260 seconds] 03:20:53 ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has joined #scheme 03:24:32 amoe [~amoe@host-78-147-167-236.as13285.net] has joined #scheme 03:26:45 toekutr [~user@50-0-51-11.dsl.static.sonic.net] has joined #scheme 03:27:09 -!- honkfestival [~honkfesti@198-84-183-94.cpe.teksavvy.com] has quit [] 03:27:52 -!- amoe_ [~amoe@host-78-147-163-176.as13285.net] has quit [Ping timeout: 244 seconds] 03:29:22 -!- ddp [~ddp@71-83-115-6.static.reno.nv.charter.com] has quit [Quit: ddp] 03:31:10 well, _I_ didn't 03:31:38 ddp [~ddp@71-83-115-6.static.reno.nv.charter.com] has joined #scheme 03:33:21 mark_weaver [~user@209-6-92-20.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com] has joined #scheme 03:33:47 amoe_ [~amoe@host-78-147-167-44.as13285.net] has joined #scheme 03:34:31 bokr [~edka@109.110.32.39] has joined #scheme 03:35:40 -!- MichaelRaskin [~MichaelRa@195.91.224.225] has quit [Quit: MichaelRaskin] 03:36:55 -!- amoe [~amoe@host-78-147-167-236.as13285.net] has quit [Ping timeout: 246 seconds] 03:37:11 hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has joined #scheme 03:38:22 -!- bokr [~edka@109.110.32.39] has quit [Client Quit] 03:39:07 -!- karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has quit [Remote host closed the connection] 03:39:32 -!- ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has quit [Ping timeout: 248 seconds] 03:49:23 karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has joined #scheme 03:51:29 -!- serhart [~serhart@173.171.144.139] has quit [Quit: Leaving.] 03:54:54 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 03:56:17 -!- hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has quit [Ping timeout: 252 seconds] 03:59:23 -!- mmc [~michal@178-85-64-28.dynamic.upc.nl] has quit [Ping timeout: 244 seconds] 04:05:38 -!- toekutr [~user@50-0-51-11.dsl.static.sonic.net] has quit [Remote host closed the connection] 04:10:23 -!- karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has quit [Remote host closed the connection] 04:11:09 toekutr [~user@50-0-51-11.dsl.static.sonic.net] has joined #scheme 04:22:27 serhart [~serhart@173.171.144.139] has joined #scheme 04:23:39 karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has joined #scheme 04:28:23 -!- cdidd [~cdidd@95-26-150-61.broadband.corbina.ru] has quit [Read error: Connection reset by peer] 04:33:30 preflex_ [~preflex@unaffiliated/mauke/bot/preflex] has joined #scheme 04:33:56 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping timeout: 252 seconds] 04:34:16 -!- preflex_ is now known as preflex 04:35:43 cdidd [~cdidd@37-144-88-223.broadband.corbina.ru] has joined #scheme 04:35:48 -!- karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has quit [Remote host closed the connection] 04:39:41 amoe [~amoe@host-78-147-97-52.as13285.net] has joined #scheme 04:42:09 -!- amoe_ [~amoe@host-78-147-167-44.as13285.net] has quit [Ping timeout: 248 seconds] 04:46:11 karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has joined #scheme 04:46:18 adu_ [~ajr@pool-108-28-107-155.washdc.fios.verizon.net] has joined #scheme 04:48:25 amgarching [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has joined #scheme 04:49:22 -!- amgarchIn9 [~amgarchin@p4FD6048B.dip0.t-ipconnect.de] has quit [Read error: Operation timed out] 04:51:53 -!- adu_ is now known as adu 04:53:06 dnolen [~user@cpe-74-64-61-245.nyc.res.rr.com] has joined #scheme 04:55:38 -!- karswell_ [~coat@93-97-29-243.zone5.bethere.co.uk] has quit [] 04:57:55 amoe_ [~amoe@host-78-147-162-11.as13285.net] has joined #scheme 05:00:57 -!- amoe [~amoe@host-78-147-97-52.as13285.net] has quit [Ping timeout: 256 seconds] 05:07:46 jozefg [~quassel@c-75-73-195-18.hsd1.mn.comcast.net] has joined #scheme 05:09:40 karswell [~user@93-97-29-243.zone5.bethere.co.uk] has joined #scheme 05:22:16 amoe [~amoe@host-78-147-99-125.as13285.net] has joined #scheme 05:26:12 -!- amoe_ [~amoe@host-78-147-162-11.as13285.net] has quit [Ping timeout: 276 seconds] 05:26:55 youlysses-ao [~user@75-132-17-145.dhcp.stls.mo.charter.com] has joined #scheme 05:27:06 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Quit: Leaving] 05:40:31 -!- amgarching [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has quit [Quit: Konversation terminated!] 05:44:43 amoe_ [~amoe@host-78-147-160-110.as13285.net] has joined #scheme 05:47:53 -!- amoe [~amoe@host-78-147-99-125.as13285.net] has quit [Ping timeout: 265 seconds] 05:53:18 -!- safekeeping [~safekeepi@c-68-36-167-104.hsd1.nj.comcast.net] has quit [Read error: Connection reset by peer] 05:53:31 -!- adu [~ajr@pool-108-28-107-155.washdc.fios.verizon.net] has quit [Quit: adu] 05:55:20 -!- dnolen [~user@cpe-74-64-61-245.nyc.res.rr.com] has quit [Remote host closed the connection] 05:58:04 -!- jao [~user@pdpc/supporter/professional/jao] has quit [Ping timeout: 256 seconds] 06:00:45 amoe [~amoe@host-78-147-170-40.as13285.net] has joined #scheme 06:03:35 -!- amoe_ [~amoe@host-78-147-160-110.as13285.net] has quit [Ping timeout: 260 seconds] 06:05:59 -!- cdidd [~cdidd@37-144-88-223.broadband.corbina.ru] has quit [Read error: Connection reset by peer] 06:07:44 -!- copumpkin [~copumpkin@unaffiliated/copumpkin] has quit [Ping timeout: 252 seconds] 06:08:14 copumpkin [~copumpkin@unaffiliated/copumpkin] has joined #scheme 06:10:03 -!- wbooze [~wbooze@xdsl-87-79-196-240.netcologne.de] has quit [Read error: Operation timed out] 06:15:45 -!- Sgeo [~Sgeo@ool-ad034ea6.dyn.optonline.net] has quit [Read error: Operation timed out] 06:24:02 garjola [~user@139.202.68.86.rev.sfr.net] has joined #scheme 06:24:03 -!- copumpkin [~copumpkin@unaffiliated/copumpkin] has quit [Ping timeout: 244 seconds] 06:24:32 copumpkin [~copumpkin@unaffiliated/copumpkin] has joined #scheme 06:26:53 adu [~ajr@pool-108-28-107-155.washdc.fios.verizon.net] has joined #scheme 06:27:14 amoe_ [~amoe@host-78-147-110-221.as13285.net] has joined #scheme 06:30:29 -!- amoe [~amoe@host-78-147-170-40.as13285.net] has quit [Ping timeout: 255 seconds] 06:41:53 -!- turbofail [~user@173-13-141-233-sfba.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 06:45:36 turbofail [~user@173-13-141-233-sfba.hfc.comcastbusiness.net] has joined #scheme 06:51:41 amoe [~amoe@host-78-147-96-59.as13285.net] has joined #scheme 06:54:42 -!- amoe_ [~amoe@host-78-147-110-221.as13285.net] has quit [Ping timeout: 240 seconds] 06:55:58 -!- garjola [~user@139.202.68.86.rev.sfr.net] has quit [Remote host closed the connection] 07:02:27 snowylike [~sn@91-67-171-156-dynip.superkabel.de] has joined #scheme 07:04:29 covi [~covi@wasp.dreamhost.com] has joined #scheme 07:06:18 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 276 seconds] 07:06:42 I am writing a simple Scheme interpreter. I want to deal with (ignore) comments in some source input string. One approach might be to preprocess the advent of the semicolon, but uses like (raw strings:) ';' and "*;*" should not be ignored. This looks complex to me. Another way is to introduce an additional data type 'Comment' into my Parser, but I haven't really experimented with this approach yet. What do you recommend? 07:08:10 shouldn't your lexer deal with strings? then the lexer can just discard everything from start-of-comment until end-of-line 07:09:11 lexer? Yes I can discard everything from start-of-comment to eol, but special judges should be given to ';' and "*;*" 07:10:33 I don't understand.. do you mean the sequence quote semicolon quote? how is that "special" in Scheme? 07:11:04 -!- mark_weaver [~user@209-6-92-20.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com] has quit [Ping timeout: 244 seconds] 07:12:30 Yes I mean the sequence. ';' is a character, and "*;*" is any string that contains a semicolon (regex syntax here). Therefore I can't simply find a semicolon then discard everything from there to the next eol 07:13:56 covi: and you shouldn't, your lexer should only tread a semicolon like that if it is not inside a string or character literal.. how are you writing your lexer? 07:14:41 also #\; is the character syntax in Scheme :) 07:15:00 oops, sorry 07:15:50 I am not writing the interpreter in Scheme, so I am not sure how to answer your question. 07:16:04 but what are you writing the lexer in? 07:16:21 So, basically, I should make sure a semicolon is not inside a string or a char? 07:16:23 Haskell 07:17:15 well, for example if you start reading a string, then disable the comment thing until you are done reading your string 07:17:23 same for a character literal 07:18:53 Let me see if it's possible to come up with a regex. 07:20:11 you are writing a lexer based solely on regular expressions? there must be something better in haskell ;) 07:20:18 parser combinators and whatnot :) 07:20:29 I am using Parsec 07:20:50 I am just thinking to use regex to filter out these comments stuff 07:24:09 I'd suggest not doing that :) especially if your strings can extend across more than one line, this gets complicated with regular expressions 07:24:11 "foo 07:24:15 ; in string 07:24:16 bar" 07:24:18 for example :) 07:24:29 which gives "foo\n; in string\nbar" on my Scheme implementation 07:27:35 Right, but this is still an ordinary string, right? 07:28:10 I'm just not familiar with Parsec enough to implement the "stop the parse comment thing when X" 07:29:36 Yes, this is a normal string, just containing embedded newlines (and I'm not sure whether the standard actually mandates this, or whether this is just something the implementation supports) 07:30:38 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 07:33:06 -!- jozefg [~quassel@c-75-73-195-18.hsd1.mn.comcast.net] has quit [Ping timeout: 264 seconds] 07:36:50 add^_ [~add^_@m37-3-63-237.cust.tele2.se] has joined #scheme 07:39:02 gravicappa [~gravicapp@h178-129-7-208.dyn.bashtel.ru] has joined #scheme 07:41:03 kk` [~kk@unaffiliated/kk/x-5380134] has joined #scheme 07:41:30 -!- kk` [~kk@unaffiliated/kk/x-5380134] has quit [Client Quit] 07:46:54 pessoa [~pessoa@188-195-211-39-dynip.superkabel.de] has joined #scheme 07:46:55 garjola [~user@goeland.ups-tlse.fr] has joined #scheme 07:46:58 -!- Kooda [~the_game@2a01:e35:2f0c:a980:2e0:4cff:fe68:999] has quit [Ping timeout: 276 seconds] 07:47:11 -!- adu [~ajr@pool-108-28-107-155.washdc.fios.verizon.net] has quit [Quit: adu] 07:53:47 -!- serhart [~serhart@173.171.144.139] has quit [Quit: Leaving.] 07:59:56 -!- ddp [~ddp@71-83-115-6.static.reno.nv.charter.com] has quit [Quit: ddp] 08:07:29 What is -*- in scheme? 08:08:02 Kooda [~the_game@2a01:e35:2f0c:a980:2e0:4cff:fe68:999] has joined #scheme 08:08:26 At the top of a file, in a comment, by any chance? 08:09:20 hkBst [~marijn@79.170.210.172] has joined #scheme 08:09:20 -!- hkBst [~marijn@79.170.210.172] has quit [Changing host] 08:09:20 hkBst [~marijn@gentoo/developer/hkbst] has joined #scheme 08:09:29 an instruction for the editor maybe? 08:09:51 It's used in heuristically parsed metadata for Emacs. 08:11:51 I see 08:12:39 I am looking at mit-scheme's handler:comment function in parse.scm. Unfortunately I don't understand the function at all. I suppose it should be used to ignore comments in source code, but throughout the definition of the function, '#\;' hasn't appeared once. 08:14:51 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 08:14:54 -!- bipt [~bpt@cpe-071-070-253-241.nc.res.rr.com] has quit [Ping timeout: 276 seconds] 08:17:14 bipt [~bpt@cpe-071-070-253-241.nc.res.rr.com] has joined #scheme 08:22:33 look in line 172 08:22:41 that's where handler:comment is registered for #\; 08:26:28 -!- ASau [~user@176.0.64.166] has quit [Ping timeout: 248 seconds] 08:30:52 -!- ffs [~garland@unaffiliated/ffs] has quit [Ping timeout: 245 seconds] 08:30:55 acedia [~rage@unaffiliated/ffs] has joined #scheme 08:31:48 -!- sonstwo [~rage@unaffiliated/ffs] has quit [Ping timeout: 276 seconds] 08:33:28 dropster [~Kim@port284.ds1-oebr.adsl.cybercity.dk] has joined #scheme 08:33:39 ffs [~garland@unaffiliated/ffs] has joined #scheme 08:35:15 ecraven: right, but I don't understand how the function body relates to the handling of comment 08:35:19 I fugured that tehre are still a few cool r3rs interpreters around 08:37:29 The traditional way of parsing, reading input, and handling comments is based on imperative + OOP way. For instance, http://norvig.com/lispy2.html 08:37:43 I have to figure out a way to do the same thing in Haskell.... 08:38:16 why not do it the haskell way? 08:38:25 (i.e. probably use some sort of lexer or parser combinators)? 08:38:32 haskell has got that lame syntax 08:38:42 covi: have to run now, be back later 08:40:44 -!- ffs [~garland@unaffiliated/ffs] has quit [Ping timeout: 246 seconds] 08:40:52 -!- acedia [~rage@unaffiliated/ffs] has quit [Ping timeout: 245 seconds] 08:43:00 ffs [~garland@unaffiliated/ffs] has joined #scheme 08:43:36 acedia [~rage@unaffiliated/ffs] has joined #scheme 08:45:22 lame syntax? 08:45:37 yeah, it lacks homoiconicity 08:45:42 -!- bipt [~bpt@cpe-071-070-253-241.nc.res.rr.com] has quit [Ping timeout: 264 seconds] 08:46:39 mmc [~michal@178-85-64-28.dynamic.upc.nl] has joined #scheme 08:47:30 Oh... 08:47:42 pessoa: right 08:47:55 Yeah, MIT Scheme uses the -*- too to affect the reader. 08:48:26 ...which I seem to recall arguing against when jrm implemented it. 08:48:55 Riastradh: do you remember why? 08:49:13 amgarchIn9 [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has joined #scheme 08:49:40 Because it's a heuristic kludge, not appropriate for affecting the semantics of the source code it's attached to. 08:49:56 Riastradh: Can you hint at how that code handles comments? 08:50:33 i'm sorry to bugger you with that - but how does it affect the semantics? i'm not familiar with MIT Scheme 08:50:42 -!- mmc [~michal@178-85-64-28.dynamic.upc.nl] has quit [Ping timeout: 240 seconds] 08:50:57 Riastradh: could you point covi to the code that handles skipping ; comments until end-of-line? I believe that's what s/he's looking for 08:51:28 snowylike, the parser is data-driven, and the table that drives it is set up in INITIALIZE-PACKAGE!. 08:51:33 -!- jrapdx [~jra@c-76-115-235-187.hsd1.wa.comcast.net] has quit [Remote host closed the connection] 08:53:17 When the reader gets to a `;' (not preceded by a `#'), it will call HANDLER:COMMENT to read the next object. 08:53:57 jrapdx [~jra@c-76-115-235-187.hsd1.wa.comcast.net] has joined #scheme 08:54:12 snowylike, it can change the case-folding behaviour of the reader and the keyword style. 08:54:23 okay 08:54:57 thanks 08:55:31 Such things should go outside a comment -- and, ideally, cause readers that don't understand them to choke, rather than silently doing the wrong thing. 08:56:19 was there any particular reason for doing it this way? 08:56:55 It follows an existing convention that jrm liked. 08:57:38 ok 08:58:02 Neither the case-folding toggle of the reader nor the whole keyword thing is very well integrated into the system anyway... 08:59:41 (I threw together one approach to making real use of keywords at , but it won't go anywhere un{til,less} MIT Scheme's macros and compilation semantics get overhauled.) 09:00:26 -!- acedia [~rage@unaffiliated/ffs] has quit [Ping timeout: 245 seconds] 09:00:28 sonstwo [~garland@unaffiliated/ffs] has joined #scheme 09:01:18 -!- ffs [~garland@unaffiliated/ffs] has quit [Ping timeout: 264 seconds] 09:04:54 -!- add^_ [~add^_@m37-3-63-237.cust.tele2.se] has quit [Quit: The Garbage Collector got me...] 09:05:32 acedia [~rage@unaffiliated/ffs] has joined #scheme 09:07:51 -!- Inode [~inode@time.uk.chromedpork.net] has quit [Ping timeout: 276 seconds] 09:16:04 azathoth99 [~g@pool-173-60-201-49.lsanca.fios.verizon.net] has joined #scheme 09:16:12 anyone awake? 09:16:45 azathoth99: most of Europe I'd guess 09:17:13 ping from China 09:17:44 Nope. I'm definitely not awake. 09:17:57 sonstwo_ [~rage@unaffiliated/ffs] has joined #scheme 09:18:16 -!- acedia [~rage@unaffiliated/ffs] has quit [Ping timeout: 260 seconds] 09:18:21 -!- sonstwo [~garland@unaffiliated/ffs] has quit [Ping timeout: 245 seconds] 09:20:29 Exercise 1.3. Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. this is kinda haunting me 09:20:36 how is it solved? 09:20:54 I am using scsh in cygwin 09:21:09 ffs [~garland@unaffiliated/ffs] has joined #scheme 09:21:55 http://pastebin.com/5HP5uFFP 09:22:00 the ugliness sofar 09:23:01 greater of a and b then greater of that and c 09:23:15 seem to find the 2 largest numbers...unless my logic is off 09:23:52 if I knew a sort function I could take the cdr of it sorting from smallest up 09:24:08 anyone bored enuf to help? 09:27:37 As scsh warns, (> ab) and (> c (> a b)) aren't likely to do you much good. 09:31:07 perhaps use define? 09:31:11 ah ha!! 09:31:20 If you want to sort a list, try (list-sort < (list a b c)). 09:35:38 -!- yacks [~yacks@180.151.36.169] has quit [Ping timeout: 252 seconds] 09:38:00 I think scsh lacks list-sort 09:38:37 You might have to `,open srfi-32' or `,open sort' or something first; I haven't used scsh in a while. 09:41:02 acedia [~rage@unaffiliated/ffs] has joined #scheme 09:41:27 sonstwo [~garland@unaffiliated/ffs] has joined #scheme 09:42:01 -!- sonstwo_ [~rage@unaffiliated/ffs] has quit [Ping timeout: 276 seconds] 09:42:14 -!- toekutr [~user@50-0-51-11.dsl.static.sonic.net] has quit [Read error: Connection reset by peer] 09:42:40 -!- ffs [~garland@unaffiliated/ffs] has quit [Ping timeout: 276 seconds] 09:42:48 I am going to do what I never do and read the book down to the exercise again. 09:46:25 For what it's worth: That exercise is by far the most befuddling one in the book, as measured by the number of people who ask about it. 09:47:13 (There are also a lot of fun different solutions; none of them is obviously best.) 09:47:41 thank gods 09:47:51 I feel retarded. 09:48:26 because i have to mix booleans with soemhow getting the list fo top 2 of 3 numbers with feeding that list back to the function to square the values 09:48:29 gaaa! 09:52:10 mutley89 [~mutley89@cpc1-swin14-2-0-cust274.3-1.cable.virginmedia.com] has joined #scheme 09:52:26 ffs [~garland@unaffiliated/ffs] has joined #scheme 09:52:48 -!- sonstwo [~garland@unaffiliated/ffs] has quit [Ping timeout: 260 seconds] 09:53:42 -!- acedia [~rage@unaffiliated/ffs] has quit [Ping timeout: 276 seconds] 09:54:48 acedia [~rage@unaffiliated/ffs] has joined #scheme 09:56:11 kvda [~kvda@ppp121-44-56-186.lns20.syd6.internode.on.net] has joined #scheme 09:57:02 yacks [~yacks@180.151.36.169] has joined #scheme 10:02:30 -!- ffs [~garland@unaffiliated/ffs] has quit [Ping timeout: 264 seconds] 10:02:49 -!- acedia [~rage@unaffiliated/ffs] has quit [Ping timeout: 276 seconds] 10:07:15 -!- yacks [~yacks@180.151.36.169] has quit [Ping timeout: 244 seconds] 10:07:49 Azathoth, Azathoth, Azathoth, the King 10:07:52 Center of the Universe,Insanity he brings, Hey! 10:10:40 -!- robot-beethoven [~user@c-24-118-142-0.hsd1.mn.comcast.net] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 10:20:19 dispatches a hound of tindalos 10:30:10 -!- b4283 [~b4283@60-249-196-111.HINET-IP.hinet.net] has quit [Remote host closed the connection] 10:33:21 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has quit [Read error: Connection reset by peer] 10:36:38 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 10:41:09 graememcc [~chatzilla@host81-157-219-65.range81-157.btcentralplus.com] has joined #scheme 10:42:18 almost got it 10:44:38 http://pastebin.com/bV7dfwad 10:45:44 -!- jonrafkind [~jon@racket/jonrafkind] has quit [Ping timeout: 252 seconds] 10:46:08 (sq-top2 5 10 1) 10:46:12 fails though... 10:46:30 (sq-top2 10 5 1) works 10:48:06 WTF 10:48:15 -!- hkBst [~marijn@gentoo/developer/hkbst] has quit [Read error: Connection reset by peer] 10:48:21 mmc [~michal@sams-office-nat.tomtomgroup.com] has joined #scheme 10:48:59 hkBst [~marijn@79.170.210.172] has joined #scheme 10:49:00 -!- hkBst [~marijn@79.170.210.172] has quit [Changing host] 10:49:00 hkBst [~marijn@gentoo/developer/hkbst] has joined #scheme 10:49:04 does not cmopute!!! 10:49:07 lol 10:49:09 GANK!!! 10:49:21 help o lisp faeries of teh woods deep!! 10:56:12 oh shit 10:56:15 i need 4 10:56:16 WOW 10:56:18 WOAAA 10:56:59 MrFahrenheit [~RageOfTho@cable-77-221-21-70.dynamic.telemach.ba] has joined #scheme 11:00:11 http://pastebin.com/L2GgELtJ 11:00:23 I feel the force flowing through me!!! 11:03:56 -!- Fare [~fare@173-9-65-97-NewEngland.hfc.comcastbusiness.net] has quit [Quit: Leaving] 11:07:46 Well, there are four cases in some sense, yes, but you should be able to determine which one you're in with just two comparisons, right? 11:10:32 I am kinda pondering that now 11:10:59 -!- adiii [~adityavit@c-76-117-52-187.hsd1.nj.comcast.net] has quit [Ping timeout: 260 seconds] 11:11:39 how do I load definition from a file again? 11:12:02 going nuts with command history 11:12:03 lol 11:12:59 (load "something.scm") 11:13:00 ok 11:15:48 -!- garjola [~user@goeland.ups-tlse.fr] has quit [Ping timeout: 264 seconds] 11:16:02 damn scsh 11:16:05 so as I say!! 11:16:12 do! 11:16:21 -!- pessoa [~pessoa@188-195-211-39-dynip.superkabel.de] has quit [Quit: Started wasting time elsewhere] 11:21:02 > (load "top2.scm") 11:21:03 top2.scm 11:21:03 Error: end of file inside list -- unbalanced parentheses 11:21:03 #{Input-port #{Input-channel "top2.scm"}} 11:21:07 Will weatoonnnn!! 11:22:56 well, this suggests you forgot a ) somewhere 11:24:32 answer_42 [~answer_42@gateway/tor-sasl/answer42/x-66983568] has joined #scheme 11:25:56 add^_ [~add^_@m37-3-63-237.cust.tele2.se] has joined #scheme 11:26:32 jaaso` [~user@178.239.26.130] has joined #scheme 11:33:10 ah shoot 11:33:22 is was with the sum-sq definition lol 11:33:37 http://pastebin.com/8EFHEwGt 11:33:40 fiixed 11:34:03 now how to reduce the above to 2 comparisons? 11:35:21 seems there at least 3 cases tho 11:35:30 -!- ski [~ski@c80-216-142-165.bredband.comhem.se] has quit [Ping timeout: 264 seconds] 11:35:58 a b a c c b 11:36:31 Way to delimit your cases. But yeah, I meant two comparisons in any individual run of the algorithm. 11:36:57 ski [~ski@c80-216-142-165.bredband.comhem.se] has joined #scheme 11:37:09 post your way 11:38:19 I can see maybe adding and or to reduce to 3 11:38:23 but to two? 11:39:22 Well, I haven't got access to a Scheme at the moment, but just think about it. Is a or b bigger? If a, then is b or c bigger? If b, then is a or c bigger? Then you know which are the two biggest. 11:39:42 -!- dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has quit [Ping timeout: 240 seconds] 11:40:04 Does that make sense? 11:40:09 yes thats 3 11:40:15 let me reduce using an or 11:40:18 one sec 11:40:21 Inode [~inode@time.uk.chromedpork.net] has joined #scheme 11:40:32 No, it's only two questions for any given a, b, c. 11:40:34 mmc3 [~michal@sams-office-nat.tomtomgroup.com] has joined #scheme 11:40:37 -!- mmc [~michal@sams-office-nat.tomtomgroup.com] has quit [Quit: Leaving.] 11:40:55 One of the questions never gets asked. 11:42:17 ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has joined #scheme 11:54:44 dsmith [~dsmith@cpe-184-56-129-232.neo.res.rr.com] has joined #scheme 11:55:54 -!- ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has quit [Ping timeout: 264 seconds] 12:01:51 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has quit [Read error: Connection reset by peer] 12:02:15 http://pastebin.com/VQnAEKR8 12:02:16 la! 12:03:53 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 12:04:13 yacks [~yacks@180.151.36.169] has joined #scheme 12:04:40 -!- yacks [~yacks@180.151.36.169] has quit [Max SendQ exceeded] 12:04:50 this whole ghc7.4 sit and Haskell Platform on OSX is messy 12:05:00 yacks [~yacks@180.151.36.169] has joined #scheme 12:07:01 -!- MrFahrenheit [~RageOfTho@cable-77-221-21-70.dynamic.telemach.ba] has quit [Quit: Leaving] 12:07:35 -!- gravicappa [~gravicapp@h178-129-7-208.dyn.bashtel.ru] has quit [Ping timeout: 260 seconds] 12:13:20 jozefg [~quassel@c-75-73-195-18.hsd1.mn.comcast.net] has joined #scheme 12:17:28 -package-confdist/package.conf.inplace is deprecated: Use -package-db instead 12:17:38 anyone know what that could mean? 12:25:33 b4283 [~b4283@1-173-100-105.dynamic.hinet.net] has joined #scheme 12:28:30 serhart [~serhart@173.171.144.139] has joined #scheme 12:28:58 -!- kvda [~kvda@ppp121-44-56-186.lns20.syd6.internode.on.net] has quit [Quit: -___-] 12:32:00 gravicappa [~gravicapp@h178-129-7-208.dyn.bashtel.ru] has joined #scheme 12:37:47 maybe ask in #haskell 12:37:52 I dunno 12:37:58 thinks work well on archlinux 12:38:04 is your mac amd64? 12:38:08 or i386? 12:38:22 ghc worked flawlessly there last time I tried 12:48:02 -!- graememcc [~chatzilla@host81-157-219-65.range81-157.btcentralplus.com] has quit [Quit: ChatZilla 0.9.89 [Firefox 18.0/20130107224849]] 12:51:45 -!- taylanub [tub@p4FD91B1A.dip.t-dialin.net] has quit [Ping timeout: 248 seconds] 12:53:47 -!- jaaso` [~user@178.239.26.130] has quit [Ping timeout: 260 seconds] 12:58:57 wbooze [~wbooze@xdsl-84-44-211-25.netcologne.de] has joined #scheme 13:02:32 garjola [~user@goeland.ups-tlse.fr] has joined #scheme 13:08:28 -!- Nisstyre [~yours@oftn/member/Nisstyre] has quit [Ping timeout: 246 seconds] 13:17:26 -!- garjola [~user@goeland.ups-tlse.fr] has quit [Remote host closed the connection] 13:22:53 Nisstyre [~yours@oftn/member/Nisstyre] has joined #scheme 13:31:31 -!- hkBst [~marijn@gentoo/developer/hkbst] has quit [Quit: Konversation terminated!] 13:34:48 -!- snowylike [~sn@91-67-171-156-dynip.superkabel.de] has quit [Quit: Nettalk6 - www.ntalk.de] 13:41:14 -!- serhart [~serhart@173.171.144.139] has quit [Quit: Leaving.] 13:43:54 sambio [~sambio@190.57.227.109] has joined #scheme 13:48:28 jao [~user@232.Red-83-32-71.dynamicIP.rima-tde.net] has joined #scheme 13:48:35 -!- jao [~user@232.Red-83-32-71.dynamicIP.rima-tde.net] has quit [Changing host] 13:48:35 jao [~user@pdpc/supporter/professional/jao] has joined #scheme 13:48:49 -!- jozefg [~quassel@c-75-73-195-18.hsd1.mn.comcast.net] has quit [Ping timeout: 248 seconds] 14:10:22 serhart [~serhart@pool-173-65-170-29.tampfl.fios.verizon.net] has joined #scheme 14:11:07 MrFahrenheit [~RageOfTho@cable-77-221-21-70.dynamic.telemach.ba] has joined #scheme 14:23:54 hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has joined #scheme 14:30:08 graememcc [~chatzilla@host81-157-219-65.range81-157.btcentralplus.com] has joined #scheme 14:59:40 -!- samth_away is now known as samth 15:09:17 kuribas [~user@94-227-88-230.access.telenet.be] has joined #scheme 15:11:50 mgodshall [~user@8.20.30.249] has joined #scheme 15:17:47 bipt [~bpt@cpe-071-070-253-241.nc.res.rr.com] has joined #scheme 15:19:48 -!- jrslepak [~jrslepak@c-71-233-149-127.hsd1.ma.comcast.net] has quit [Quit: What happened to Systems A through E?] 15:21:07 bro_grammer [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has joined #scheme 15:23:59 -!- hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has quit [Ping timeout: 244 seconds] 15:24:46 stat_vi [~stat@dslb-094-218-227-062.pools.arcor-ip.net] has joined #scheme 15:30:23 -!- bro_grammer [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has quit [Ping timeout: 252 seconds] 15:31:34 cdidd [~cdidd@95-26-150-2.broadband.corbina.ru] has joined #scheme 15:38:07 -!- dropster [~Kim@port284.ds1-oebr.adsl.cybercity.dk] has left #scheme 15:40:23 -!- kuribas [~user@94-227-88-230.access.telenet.be] has quit [Remote host closed the connection] 15:40:24 ni__ [~ni@c-66-30-141-98.hsd1.ct.comcast.net] has joined #scheme 15:48:17 PuercoPop [~user@190.222.252.106] has joined #scheme 15:51:12 jrslepak [~jrslepak@nomad.ccs.neu.edu] has joined #scheme 15:53:05 spobat [~spobat@p5DC76BD8.dip.t-dialin.net] has joined #scheme 15:53:54 -!- cmatei [~cmatei@78.96.108.212] has quit [Read error: Connection reset by peer] 15:54:34 cmatei [~cmatei@78.96.108.212] has joined #scheme 15:56:42 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has quit [Quit: MichaelRaskin] 16:24:04 Tau [~Euler@186.194.51.29] has joined #scheme 16:24:13 -!- jrslepak [~jrslepak@nomad.ccs.neu.edu] has quit [Quit: What happened to Systems A through E?] 16:27:42 -!- mutley89 [~mutley89@cpc1-swin14-2-0-cust274.3-1.cable.virginmedia.com] has quit [Ping timeout: 264 seconds] 16:31:50 snowylike [~sn@91-67-171-156-dynip.superkabel.de] has joined #scheme 16:35:50 mutley89 [~mutley89@cpc1-swin14-2-0-cust274.3-1.cable.virginmedia.com] has joined #scheme 16:39:08 carleastlund [~cce@gotham.ccs.neu.edu] has joined #scheme 16:40:15 -!- azathoth99 [~g@pool-173-60-201-49.lsanca.fios.verizon.net] has quit [Read error: Connection reset by peer] 16:41:38 huseby [~huseby@gateway/tor-sasl/huseby] has joined #scheme 16:44:23 kuribas [~user@94-227-88-230.access.telenet.be] has joined #scheme 16:47:28 ddp [~ddp@71-83-115-6.static.reno.nv.charter.com] has joined #scheme 16:53:44 -!- ddp [~ddp@71-83-115-6.static.reno.nv.charter.com] has quit [Quit: ddp] 16:57:37 -!- sambio [~sambio@190.57.227.109] has quit [Read error: Connection reset by peer] 16:57:53 sambio [~sambio@190.57.227.109] has joined #scheme 17:08:55 -!- snowylike [~sn@91-67-171-156-dynip.superkabel.de] has quit [Read error: Connection reset by peer] 17:12:25 mark_weaver [~user@209-6-92-20.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com] has joined #scheme 17:13:51 Tau: I looked at your code. Would you like to see a one-line solution to the problem? 17:17:48 kk` [~kk@unaffiliated/kk/x-5380134] has joined #scheme 17:20:04 MichaelRaskin [~MichaelRa@195.91.224.225] has joined #scheme 17:20:40 hiroakip [~hiroaki@ip-5-147-122-136.unitymediagroup.de] has joined #scheme 17:21:22 mark_weaver for sure. 17:21:34 mark_weaver would you use lcm right? 17:22:04 i knew of lcm. but as i'm a beginner in scheme .. i thought of implementing it by hand. 17:23:00 With SRFI-1: (reduce lcm 1 (iota 20 1)), or without it: (apply lcm (iota 20 1)) 17:23:28 (the reduce solution is preferable) 17:23:48 actually, I guess you need SRFI-1 for 'iota' anyway. 17:25:31 even without lcm, it can be done much more nicely. 17:28:58 mark_weaver how would you do it without lcm 17:31:09 -!- spobat [~spobat@p5DC76BD8.dip.t-dialin.net] has quit [Quit: Leaving] 17:32:15 well, as you did, I would probably write my own 'lcm', but I would implement 'lcm' based on 'gcd', and implement 'gcd' based on euclid's algorithm. 17:33:46 'gcd' can be implemented as shown in http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.5 17:34:25 and (lcm a b) is just (/ (abs (* a b)) (gcd a b)) 17:34:38 -!- wbooze [~wbooze@xdsl-84-44-211-25.netcologne.de] has quit [Remote host closed the connection] 17:34:59 and I would use 'reduce' from SRFI-1 to generalize this to multiple arguments, instead of building that iteration logic into 'lcm' and 'gcd'. 17:36:26 rudybot: (define (my-gcd a b) (if (= b 0) a (my-gcd b (remainder a b)))) 17:36:26 mark_weaver: your sandbox is ready 17:36:26 mark_weaver: Done. 17:36:57 rudybot: (define (my-lcm a b) (/ (abs (* a b)) (my-gcd a b))) 17:36:57 mark_weaver: Done. 17:37:09 wbooze [~wbooze@xdsl-84-44-211-25.netcologne.de] has joined #scheme 17:37:21 rudybot: (reduce my-lcm 1 (iota 20 1)) 17:37:21 mark_weaver: error: reference to an identifier before its definition: reduce in module: 'program 17:38:41 rudybot: (require srfi/1) 17:38:41 mark_weaver: Done. 17:38:43 rudybot: (reduce my-lcm 1 (iota 20 1)) 17:38:43 mark_weaver: ; Value: 232792560 17:38:59 there... 17:41:26 mark_weaver yup. 17:41:33 mark_weaver i knew of such algorithm. 17:41:46 mark_weaver i guess it is slower than the other one. 17:41:56 mark_weaver cause it requires more computations. 17:42:21 hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has joined #scheme 17:43:05 mark_weaver although i'm not using a good implementation for is-prime http://codepad.org/c8R0MlrQ 17:43:30 I haven't tried to fully understand your code, but I see that you are factoring numbers, which sounds slower than euclid's algorithm. 17:44:23 mark_weaver maybe. 17:44:29 mark_weaver what about scheduling both 17:44:37 go for it! :) 17:44:45 mark_weaver lol you do it. 17:45:31 mark_weaver if i implemented a hash table of prime numbers i think mine would be faster. 17:45:42 mark_weaver try to put 17:45:46 a big number in it 17:46:02 I'm not motivated to bother. anyway, it was not my intention to compete here. I just wanted to make sure you understood how nicely things can be written in Scheme if you use higher-order procedures. 17:46:14 mark_weaver i'm not competing. 17:46:34 mark_weaver i'm just curious which one is faster. 17:46:49 mark_weaver but yeah. i know that way would be simpler. 17:47:11 -!- ecraven [~user@www.nexoid.at] has quit [Ping timeout: 255 seconds] 17:47:13 mark_weaver i was aware of that. but as i'm a beginner i tried to implement this other algorithm cause it is more complex then i could practice stuff etc. 17:47:22 (beginning in scheme). 17:47:27 *nod* 17:47:44 mark_weaver hm? 17:48:48 well, some stylistic comments: you use nested 'if's in several places where 'cond' would probably look a bit nicer. 17:49:24 mark_weaver hmm. 17:49:45 mark_weaver so if i have 'two' nested ifs it is better stylistically using cond? 17:49:59 it's a matter of taste, but imo yes 17:50:12 ASau [~user@46.115.44.204] has joined #scheme 17:50:36 also, 'get-greatest-power' could be written more nicely using 'reduce' and 'max' 17:52:01 mark_weaver hmm 17:52:02 (car (cdr (car xs))) could be written (cadar xs), but even so it makes for hard-to-understand code. 17:52:09 mark_weaver oh great. 17:52:10 nice. 17:52:20 mark_weaver well. i didnt know of cadar. 17:52:27 mark_weaver nice to know of. 17:52:42 -!- kuribas [~user@94-227-88-230.access.telenet.be] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 17:52:54 well, if you find yourself needing those procedures in a place like this, it's a sign that you're probably doing something wrong. 17:52:57 mark_weaver i will reimplement it using your tips. 17:53:19 mark_weaver do you have any other advices? 17:53:34 to save myself some time, what is the expected structure of the 'xs' list passed into 'get-power' ? 17:54:23 For writing loops more nicely, you might want to look at either SRFI-42 or foof-loop. 17:55:48 Tau: in 'get-greatest-power' you wrote this: (if (< c q) (iter (cdr xs) q) (iter (cdr xs) c)), which could be written as (iter (cdr xs) (max c q)) 17:56:07 (though probably it could use a more fundamental restructuring) 17:56:13 mark_weaver a moment. 17:56:16 i will drink some water. 17:56:18 -!- mmc3 [~michal@sams-office-nat.tomtomgroup.com] has quit [Ping timeout: 276 seconds] 17:57:11 okay, I have more to say, but will wait... 17:59:31 -!- BossKonaSegwaY [~Michael@cpe-75-187-42-68.columbus.res.rr.com] has quit [Read error: No route to host] 18:00:02 BossKonaSegwaY [~Michael@cpe-75-187-42-68.columbus.res.rr.com] has joined #scheme 18:01:04 http://codepad.org/EtoPrnWG 18:01:05 -!- copumpkin [~copumpkin@unaffiliated/copumpkin] has quit [Ping timeout: 252 seconds] 18:01:17 mark_weaver it receives a list of factors and their powers. 18:01:29 then when i pass such a list and one of the factors it returns the factor power. 18:01:34 copumpkin [~copumpkin@unaffiliated/copumpkin] has joined #scheme 18:02:09 -!- huseby [~huseby@gateway/tor-sasl/huseby] has quit [Ping timeout: 276 seconds] 18:02:45 okay, in that case, instead of using (car x) and (car (cdr x)), you should write auxilliary procedures to make the code more readable. 18:03:31 huseby [~huseby@gateway/tor-sasl/huseby] has joined #scheme 18:03:58 adu [~ajr@pool-108-28-107-155.washdc.fios.verizon.net] has joined #scheme 18:04:01 maybe something like (define (make-power factor exponent) (cons factor exponent)) (define (power-factor p) (car p)) (define (power-exponent p) (cadr p)) 18:04:39 that will make the rest of your code much more readable. 18:05:00 mark_weaver true. i like to split off things into smaller pieces. but i'm finding some difficult to do it with scheme. 18:05:13 note that SRFI-1 also has 'first', 'second', 'third', etc... which are 'car', 'cadr', 'caddr', etc. 18:06:05 mark_weaver what is SRFI-1? 18:06:09 can you give an example of something you find difficult to split off in scheme? 18:07:11 SRFI-1 is a very commonly-used list library, available for most implementations. See http://srfi.schemers.org/ 18:07:23 mark_weaver http://codepad.org/LUekKveN 18:07:36 not all of them are widely supported, but many of them are. 18:07:41 mark_weaver how would you split that function off into other functions? 18:07:45 and SRFI-1 is supported almost everywhere. 18:07:58 how would I split which function? 18:08:18 also see SRFI-9 (records) 18:08:34 mark_weaver the one that i posted. 18:08:38 http://codepad.org/LUekKveN 18:08:52 mark_weaver so they are like 'modules' in python? 18:08:57 the SRFI-9 18:09:02 and SRFI-1. 18:09:04 nice. 18:09:08 looking... 18:09:18 mark_weaver i'm using mit scheme. 18:09:54 i will figure out how to install those modules with mit-scheme. 18:13:39 ecraven [~user@www.nexoid.at] has joined #scheme 18:18:20 Guest72783 [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has joined #scheme 18:19:14 -!- Guest72783 [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has left #scheme 18:20:04 -!- wbooze [~wbooze@xdsl-84-44-211-25.netcologne.de] has quit [Ping timeout: 248 seconds] 18:21:27 adiii [~adityavit@c-76-117-52-187.hsd1.nj.comcast.net] has joined #scheme 18:23:57 petr` [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has joined #scheme 18:24:12 SRFI 1 and SRFI 9 are both built-in to Python. 18:24:15 ...am 18:24:16 er 18:24:17 MIT Scheme 18:24:17 !????!??!?!?!? 18:24:19 !*@&#^%!^&#*! 18:24:22 *poof* 18:24:43 ...what in the world just happened there? 18:24:54 who are you and what have you done with Riastradh? 18:25:19 Klaatu barata nikto! 18:26:00 i'm trying to find nice implemention for a function that tests whether a number is prime. 18:26:01 ... or should say: Guidostradh??? 18:26:09 -!- copumpkin [~copumpkin@unaffiliated/copumpkin] has quit [Ping timeout: 248 seconds] 18:26:10 should we! 18:26:21 it is odd. i put on google different things but i couldnt find a link about it. 18:26:27 Tau: here's a way to do it using 'fold', though perhaps it could be made simpler. http://codepad.org/w20oQWO5 18:26:37 copumpkin [~copumpkin@unaffiliated/copumpkin] has joined #scheme 18:27:30 mark_weaver i see. 18:27:46 mark_weaver good one. 18:28:42 Tau: do you want a probabilistic primality test that will work for huge numbers, or the Sieve of Eratosthenes? 18:29:27 mark_weaver a precise one is okay. 18:29:37 you're primality test has a flaw: because it uses inexact 'sqrt', it could fail for large numbers. 18:29:38 mark_weaver the sieve one would work fine. 18:29:44 s/you're/your/ 18:29:57 mark_weaver i'm using round on it. 18:30:04 mark_weaver wouldn't it round to the greatest one? 18:30:32 mark_weaver i mean, if i pass 2.5 wouldn't it round to 3? 18:30:41 the problem is that (sqrt ) will use inexact-floating point on most implementations (virtually all if is not a perfect square). 18:31:04 so you can 'round' it if you like, but it still might be very far from the correct answer, and you might miss some factors. 18:31:06 mark_weaver so, should i add +1 to it? 18:31:15 mark_weaver i see. 18:31:51 no, you can't do it that way at all. modern scheme standards have 'exact-integer-sqrt' that will give a precise answer even for large integers. 18:32:37 alternatively, test (<= (* c c) n) instead. 18:33:16 -!- ski [~ski@c80-216-142-165.bredband.comhem.se] has quit [Quit: leaving] 18:33:23 you can't just add +1, because if is very large, the provided square root could be arbitrarily far away from the correct answer. 18:33:33 -!- hash_table [~quassel@70-138-246-219.lightspeed.hstntx.sbcglobal.net] has quit [Ping timeout: 256 seconds] 18:34:44 ski [~ski@c80-216-142-165.bredband.comhem.se] has joined #scheme 18:36:01 mark_weaver i see. 18:41:14 -!- copumpkin [~copumpkin@unaffiliated/copumpkin] has quit [Ping timeout: 252 seconds] 18:41:43 copumpkin [~copumpkin@unaffiliated/copumpkin] has joined #scheme 18:45:55 jrslepak [~jrslepak@nomad.ccs.neu.edu] has joined #scheme 18:48:22 petr [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has joined #scheme 18:48:47 -!- petr is now known as Guest14648 18:48:58 -!- Guest14648 [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has quit [Client Quit] 18:49:05 -!- petr` [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 18:49:21 petr` [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has joined #scheme 18:49:30 #scheme 18:52:41 Tau: here's one way to write a simple precise primality test, though I optimized it a bit to avoid squaring: http://codepad.org/zAXCpGfr 18:53:53 mark_weaver good. i think sqrt was slowing down the is-prime function. 18:54:12 probably cause it was attempting to approximate it to the real square root by some method. 18:54:41 -!- amgarchIn9 [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has quit [Quit: Konversation terminated!] 18:54:59 amgarchIn9 [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has joined #scheme 18:56:05 -!- hiroakip [~hiroaki@ip-5-147-122-136.unitymediagroup.de] has quit [Ping timeout: 252 seconds] 18:57:03 I suspect that floating-point 'sqrt' is highly optimized by modern processors, but nonetheless it is imprecise and thus cannot be used here. 18:57:28 mark_weaver i get your point. 19:01:44 though I confess the point may be moot, because for any 'n' large enough to cause floating-point 'sqrt' to be imprecise, we'd probably all be dead before this program finished running :) 19:02:21 mark_weaver lol true. 19:03:26 mmc [~michal@178-85-64-28.dynamic.upc.nl] has joined #scheme 19:08:46 -!- gravicappa [~gravicapp@h178-129-7-208.dyn.bashtel.ru] has quit [Ping timeout: 265 seconds] 19:14:29 dnolen [aa95640a@gateway/web/freenode/ip.170.149.100.10] has joined #scheme 19:18:43 hiroakip [~hiroaki@ip-5-147-122-136.unitymediagroup.de] has joined #scheme 19:22:18 -!- mutley89 [~mutley89@cpc1-swin14-2-0-cust274.3-1.cable.virginmedia.com] has quit [Ping timeout: 264 seconds] 19:26:41 -!- yacks [~yacks@180.151.36.169] has quit [Quit: Leaving] 19:30:33 -!- answer_42 [~answer_42@gateway/tor-sasl/answer42/x-66983568] has quit [Ping timeout: 276 seconds] 19:30:33 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 276 seconds] 19:31:45 -!- adu [~ajr@pool-108-28-107-155.washdc.fios.verizon.net] has quit [Quit: adu] 19:37:12 francisl [~flavoie@199.84.164.114] has joined #scheme 19:47:01 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 19:49:18 -!- drewc [~drewc@50.7.166.100] has quit [Quit: ZNC - http://znc.sourceforge.net] 19:49:48 drewc [~drewc@50.7.166.100] has joined #scheme 20:01:03 wbooze [~wbooze@xdsl-87-79-198-197.netcologne.de] has joined #scheme 20:26:39 jonrafkind [~jon@racket/jonrafkind] has joined #scheme 20:28:30 toekutr [~user@50-0-51-11.dsl.static.sonic.net] has joined #scheme 20:30:51 -!- mark_weaver [~user@209-6-92-20.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com] has quit [Read error: Operation timed out] 20:34:54 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 276 seconds] 20:35:59 -!- tonyg_ is now known as tonyg 20:38:48 Fare [fare@nat/google/x-dcyctbmqjdmzcjnf] has joined #scheme 20:41:18 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 20:44:43 taylanub [tub@p4FD9261F.dip.t-dialin.net] has joined #scheme 20:54:24 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 276 seconds] 21:00:53 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 21:04:46 -!- jonrafkind [~jon@racket/jonrafkind] has quit [Ping timeout: 265 seconds] 21:12:14 -!- stat_vi [~stat@dslb-094-218-227-062.pools.arcor-ip.net] has quit [Quit: Lost terminal] 21:30:28 -!- wingo [~wingo@cha74-2-88-160-190-192.fbx.proxad.net] has quit [Ping timeout: 248 seconds] 21:31:27 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 276 seconds] 21:35:50 -!- amgarchIn9 [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has quit [Quit: Konversation terminated!] 21:37:43 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 21:37:56 -!- jrslepak [~jrslepak@nomad.ccs.neu.edu] has quit [Quit: What happened to Systems A through E?] 21:48:15 snowylike [~sn@91-67-171-156-dynip.superkabel.de] has joined #scheme 21:51:15 -!- francisl [~flavoie@199.84.164.114] has quit [Quit: francisl] 21:52:30 jonrafkind [~jon@racket/jonrafkind] has joined #scheme 22:02:08 -!- Nisstyre [~yours@oftn/member/Nisstyre] has quit [Quit: Leaving] 22:08:34 -!- jrapdx [~jra@c-76-115-235-187.hsd1.wa.comcast.net] has quit [Remote host closed the connection] 22:13:09 jrslepak [~jrslepak@c-71-233-149-127.hsd1.ma.comcast.net] has joined #scheme 22:19:25 snorble_ [~snorble@213.101.209.229] has joined #scheme 22:20:18 -!- snorble_ [~snorble@213.101.209.229] has left #scheme 22:21:14 snorble_ [~snorble@213.101.209.229] has joined #scheme 22:23:15 amgarchIn9 [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has joined #scheme 22:24:39 amgarching [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has joined #scheme 22:24:50 -!- amgarchIn9 [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 22:29:30 -!- amgarching [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 22:29:39 amgarching [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has joined #scheme 22:30:44 -!- sad0ur [~sad0ur@ip-78-102-146-61.net.upcbroadband.cz] has quit [Ping timeout: 244 seconds] 22:32:24 -!- serhart [~serhart@pool-173-65-170-29.tampfl.fios.verizon.net] has quit [Quit: Leaving.] 22:38:23 sad0ur [~sad0ur@ip-78-102-146-61.net.upcbroadband.cz] has joined #scheme 22:51:13 -!- carleastlund [~cce@gotham.ccs.neu.edu] has quit [Quit: carleastlund] 22:57:58 robot-beethoven [~user@c-24-118-142-0.hsd1.mn.comcast.net] has joined #scheme 22:59:29 -!- wbooze [~wbooze@xdsl-87-79-198-197.netcologne.de] has quit [Remote host closed the connection] 23:04:47 wbooze [~wbooze@xdsl-87-79-198-197.netcologne.de] has joined #scheme 23:09:25 -!- petr` [~user@pptp-212-201-70-251.pptp.stw-bonn.de] has left #scheme 23:11:15 serhart [~serhart@173.171.144.139] has joined #scheme 23:11:30 -!- graememcc [~chatzilla@host81-157-219-65.range81-157.btcentralplus.com] has quit [Ping timeout: 264 seconds] 23:14:12 -!- dnolen [aa95640a@gateway/web/freenode/ip.170.149.100.10] has quit [Ping timeout: 245 seconds] 23:21:57 mark_weaver [~user@TURNTABLE.MIT.EDU] has joined #scheme 23:23:36 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 23:26:05 -!- samth is now known as samth_away 23:26:36 -!- snowylike [~sn@91-67-171-156-dynip.superkabel.de] has quit [Quit: Nettalk6 - www.ntalk.de] 23:31:24 -!- Khisanth [~Khisanth@50.14.244.111] has quit [Ping timeout: 276 seconds] 23:32:49 -!- bipt [~bpt@cpe-071-070-253-241.nc.res.rr.com] has quit [Ping timeout: 248 seconds] 23:34:30 -!- youlysses-ao [~user@75-132-17-145.dhcp.stls.mo.charter.com] has quit [Read error: Connection reset by peer] 23:35:06 -!- add^_ [~add^_@m37-3-63-237.cust.tele2.se] has quit [Quit: The Garbage Collector got me...] 23:36:54 -!- amgarching [~amgarchin@p4FD60321.dip0.t-ipconnect.de] has quit [Ping timeout: 276 seconds] 23:44:56 Khisanth [~Khisanth@50.14.244.111] has joined #scheme 23:46:17 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 255 seconds] 23:49:16 -!- mark_weaver [~user@TURNTABLE.MIT.EDU] has quit [Ping timeout: 244 seconds] 23:50:34 -!- snits [~snits@inet-hqmc06-o.oracle.com] has quit [Remote host closed the connection] 23:56:14 snits [~snits@174-17-112-107.phnx.qwest.net] has joined #scheme 23:59:32 dnolen [~user@cpe-74-64-61-245.nyc.res.rr.com] has joined #scheme