00:05:46 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Quit: Computer has gone to sleep.] 00:06:49 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 245 seconds] 00:22:42 githogori [~githogori@c-24-7-1-43.hsd1.ca.comcast.net] has joined #scheme 00:27:53 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 00:28:15 -!- pygospa [~TheRealPy@kiel-5f768434.pool.mediaWays.net] has quit [Disconnected by services] 00:28:24 pygospa [~TheRealPy@kiel-4dbec4c5.pool.mediaWays.net] has joined #scheme 00:30:05 -!- jonrafkind [~jon@crystalis.cs.utah.edu] has quit [Ping timeout: 258 seconds] 00:36:34 Brendan_T [~brendan@static.112.22.47.78.clients.your-server.de] has joined #scheme 00:39:23 (define bla ((lambda () (define foo 0) foo))) <- is there another way to write something like this? (i.e., having the evaluation of bla inside of bla itself, if that makes sense) 00:40:27 -!- tali713 [~user@c-76-17-236-129.hsd1.mn.comcast.net] has quit [Ping timeout: 276 seconds] 00:40:35 malorie: I'm not sure what you're trying to do. 00:41:17 (define blah (let ((foo 0)) (stuff! foo) foo)) ? 00:41:23 basically, I'd like to use `bla` instead of `(bla)` 00:42:11 what is stuff! ? 00:43:16 The fate of turkeys. 00:43:32 as in do stuff here 00:43:48 assuming you want to do something 00:43:53 I see 00:44:00 What if I want to do nothing? 00:44:07 Jafet: s/fate/purpose/ 00:44:16 That looks like a well-obfuscated way to write (define bla 0) 00:44:36 well. it's a test case, sort of 00:45:35 It doesn't seem to test anything--it's completely equivalent to (define bla 0) 00:46:29 (define bla ((lambda () (define f (lambda (x) (stuff! x))) (f 0)))) better 00:47:48 -!- masm [~masm@bl15-76-105.dsl.telepac.pt] has quit [Quit: Leaving.] 00:49:52 so, (define blah (letrec ((f (lambda (x) (stuff! x)))) (f 0))) 00:52:49 ah, I see. but couldn't I just use a let there? 00:53:19 if the function isn't recursive then sure 00:53:22 You can use a let, since the lambda's body doesn't refer to f. 00:53:55 If the inner lambda's body does refer to f, and you want it to refer to itself rather than an outer f, then letrec is necessary. 00:55:13 so I'd have to use letrec if *any* of the bindings occur in one of the lambdas? 00:55:23 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 00:55:34 malorie: If you want to use the innermost binding, then yes. 00:55:59 I see. thanks, so far :-) 00:56:11 :-) 00:56:46 I was also wondering, whether restricting oneself to "pure" scheme is stupid. should I look into Racket or PLT or some-such? 00:57:04 What does pure mean 00:57:11 -!- jrapdx [~jra@74-95-41-205-Oregon.hfc.comcastbusiness.net] has quit [Quit: Leaving] 00:57:15 RnRS 00:58:03 If you want to program in r5rs, then it's not stupid to use r5rs. If you want to write some trendy thing like a Web Service... 00:58:25 jrapdx [~chatzilla@74-95-41-205-Oregon.hfc.comcastbusiness.net] has joined #scheme 00:58:40 -!- soveran [~soveran@rrcs-24-43-163-86.west.biz.rr.com] has quit [Remote host closed the connection] 00:59:52 malorie: There's probably not very much practical that can get done with "only" R5RS, but if you added some SRFIs, then you can do somewhat more.... 01:00:11 -!- rpg [~rpg@216.243.156.16.real-time.com] has quit [Quit: rpg] 01:02:00 -!- jao [~user@pdpc/supporter/professional/jao] has quit [Read error: Operation timed out] 01:02:36 fair enough. but is adding SRFIs portable? as in, might a certain implementation not provide a given SRFI? 01:02:53 "Yes." 01:03:17 well. at least it's portably unportable, I guess 01:03:38 There are nearly as many scheme implementations as scheme programmers, but the common implementations provide common SRFIs. 01:05:15 jcowan [~John@cpe-74-68-112-189.nyc.res.rr.com] has joined #scheme 01:08:02 hoi 01:14:56 -!- gigamonkey [~user@adsl-99-2-150-45.dsl.pltn13.sbcglobal.net] has quit [Ping timeout: 258 seconds] 01:20:24 -!- jrapdx [~chatzilla@74-95-41-205-Oregon.hfc.comcastbusiness.net] has quit [Quit: ChatZilla 0.9.87 [Firefox 5.0/20110711025042]] 01:20:36 leo2007 [~leo@58.22.114.192] has joined #scheme 01:20:52 Top of the evening to you, jcowan. 01:21:10 Hey ho, gnomon. 01:23:24 Anything of interest to report? 01:26:36 Not really. The next ballot is due in 9 days, so we'll see what the WG has to say. 01:29:22 wbooze [~levgue@xdsl-78-35-164-5.netcologne.de] has joined #scheme 01:29:38 homie [~levgue@xdsl-78-35-164-5.netcologne.de] has joined #scheme 01:46:47 People tend to vote at the last minute 01:48:54 -!- danly|work [~user@216.81.48.202.epikip.net] has quit [Ping timeout: 245 seconds] 01:51:10 bgs100 [~ian@unaffiliated/bgs100] has joined #scheme 01:51:30 -!- bgs100 [~ian@unaffiliated/bgs100] has quit [Remote host closed the connection] 01:55:48 *foof* should've set a shorter deadline 01:56:16 -!- Kajtek [~nope@nat4-230.ghnet.pl] has quit [Quit: Leaving.] 01:58:45 foof: I'm glad that you did not. 02:17:48 -!- arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has quit [Read error: Connection reset by peer] 02:18:06 arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has joined #scheme 02:20:06 -!- arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has quit [Read error: Connection reset by peer] 02:20:15 arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has joined #scheme 02:28:04 rbuck [~rbuck@66-189-68-77.dhcp.oxfr.ma.charter.com] has joined #scheme 02:32:08 -!- rbuck [~rbuck@66-189-68-77.dhcp.oxfr.ma.charter.com] has quit [Remote host closed the connection] 02:46:28 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 240 seconds] 02:49:01 gigamonkey [~user@adsl-99-2-150-45.dsl.pltn13.sbcglobal.net] has joined #scheme 02:49:08 -!- dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has quit [Quit: dnolen] 02:51:39 dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has joined #scheme 02:56:53 -!- eno [~eno@nslu2-linux/eno] has quit [Ping timeout: 258 seconds] 02:58:31 eno [~eno@nslu2-linux/eno] has joined #scheme 02:59:43 -!- dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has quit [Quit: dnolen] 03:01:01 rpg [~rpg@216.243.156.16.real-time.com] has joined #scheme 03:01:28 -!- ijp [~user@host109-154-210-10.range109-154.btcentralplus.com] has quit [Quit: tired] 03:03:10 -!- rvn_ [~rvn@77.107.164.131] has quit [Quit: Leaving] 03:05:08 -!- arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has quit [Read error: Connection reset by peer] 03:06:55 jonrafkind [~jon@jonr5.dsl.xmission.com] has joined #scheme 03:19:59 Jafet1 [~Jafet@unaffiliated/jafet] has joined #scheme 03:22:41 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Ping timeout: 240 seconds] 03:26:24 -!- turbofail [~user@c-107-3-149-149.hsd1.ca.comcast.net] has quit [Ping timeout: 258 seconds] 03:30:06 -!- G_ [~G@41.51.68.86.rev.sfr.net] has quit [Ping timeout: 276 seconds] 03:32:11 -!- Jafet1 is now known as Jafet 03:39:58 sodel [~dralston_@S0106687f74a12729.va.shawcable.net] has joined #scheme 03:43:40 drdo [~drdo@91.205.108.93.rev.vodafone.pt] has joined #scheme 03:55:35 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Quit: Leaving.] 03:58:30 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 04:00:38 realitygrill_ [~realitygr@adsl-76-226-114-237.dsl.sfldmi.sbcglobal.net] has joined #scheme 04:02:23 -!- MichaelRaskin [~MichaelRa@195.91.224.225] has left #scheme 04:02:36 -!- rpg [~rpg@216.243.156.16.real-time.com] has quit [Ping timeout: 268 seconds] 04:03:54 -!- realitygrill [~realitygr@76.226.203.107] has quit [Ping timeout: 245 seconds] 04:03:54 -!- realitygrill_ is now known as realitygrill 04:09:17 rpg [~rpg@216.243.156.16.real-time.com] has joined #scheme 04:10:52 jrapdx [~chatzilla@c-98-246-157-58.hsd1.or.comcast.net] has joined #scheme 04:10:57 -!- rpg [~rpg@216.243.156.16.real-time.com] has quit [Client Quit] 04:29:16 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 04:33:43 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 04:39:03 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 04:39:25 -!- jcowan [~John@cpe-74-68-112-189.nyc.res.rr.com] has quit [Quit: Leaving] 04:46:07 -!- rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has quit [Remote host closed the connection] 04:47:47 rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has joined #scheme 04:48:25 -!- leo2007 [~leo@58.22.114.192] has quit [Quit: rcirc on GNU Emacs 23.3.50.1] 04:54:35 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Quit: Leaving.] 04:56:32 -!- phax [~phax@unaffiliated/phax] has quit [Read error: Operation timed out] 05:00:50 -!- jrapdx [~chatzilla@c-98-246-157-58.hsd1.or.comcast.net] has quit [Quit: ChatZilla 0.9.87 [Firefox 5.0/20110711025042]] 05:01:17 jrapdx [~jra@c-98-246-157-58.hsd1.or.comcast.net] has joined #scheme 05:01:48 -!- jrapdx [~jra@c-98-246-157-58.hsd1.or.comcast.net] has quit [Client Quit] 05:32:16 tali713 [~user@c-76-17-236-129.hsd1.mn.comcast.net] has joined #scheme 05:37:36 -!- drdo [~drdo@91.205.108.93.rev.vodafone.pt] has quit [Ping timeout: 250 seconds] 05:37:54 -!- rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has quit [Remote host closed the connection] 05:39:32 rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has joined #scheme 05:45:41 dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has joined #scheme 05:47:29 -!- rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has quit [Remote host closed the connection] 05:47:52 wbooze` [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 05:48:12 homie` [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 05:50:08 -!- wbooze [~levgue@xdsl-78-35-164-5.netcologne.de] has quit [Ping timeout: 258 seconds] 05:50:56 -!- homie [~levgue@xdsl-78-35-164-5.netcologne.de] has quit [Ping timeout: 258 seconds] 05:54:49 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 05:59:22 rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has joined #scheme 06:01:22 -!- dfjkldfajkl [~paulh@145.120.22.54] has quit [Read error: Operation timed out] 06:13:32 -!- tupi [~david@189.60.180.75] has quit [Remote host closed the connection] 06:17:16 -!- dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has quit [Quit: dnolen] 06:23:03 jrapdx [~jra@c-98-246-157-58.hsd1.or.comcast.net] has joined #scheme 06:35:05 hkBst [~quassel@gentoo/developer/hkbst] has joined #scheme 06:37:50 doomrobo [~michael@187.141.68.34] has joined #scheme 06:39:07 when I place a conditional in a (do) that, when true, returns #f, it never returns it. I checked that it *is* true when it's supposed to be, it just doesn't return #f 06:40:01 doomrobo: Do you have some code that demonstrates that? 06:40:06 yes, hold on 06:40:20 btw, it's mit-scheme 06:40:25 *nods* 06:41:49 dammit, I can't find it. I'll just rewrite it, it's really short 06:41:51 brb 06:42:06 nvm 06:42:08 found it 06:42:39 -!- jonrafkind [~jon@jonr5.dsl.xmission.com] has quit [Ping timeout: 245 seconds] 06:44:40 I warn you, the indentation is off so it's ugly, but here you go: http://pastebin.com/HcVte7gA 06:48:33 I suppose I could have done it using (modulo) but it should work the same way 06:57:56 *checks* 06:58:07 (Sorry, spent the last 15 minutes on Stack Overflow. ;-)) 06:58:17 'sokay, I love SO 06:58:25 :-) 06:58:40 I'm one of the earliest users of SO, so I'm biased. :-P 06:58:47 ha 07:00:55 doomrobo: The body of the "do" loop does not return anything, ever. 07:01:24 ? 07:01:27 doomrobo: In your case, I suggest you use a named let, rather than a do. 07:01:51 wait, doesn't do return something? I read that somewhere 07:01:54 Where your "#t" is, that's the only place where you can specify a return value for your do loop. 07:02:03 oh 07:02:04 gotcha 07:02:07 that sucks 07:02:09 why is that? 07:02:29 Because that's the point where the exit condition is tested. 07:02:54 I know that, but isn't that kind of odd not to allow any other return values in a do? 07:03:51 You can do something like, have the exit condition be (or (> i l) (zero? (modulo x i))). 07:04:07 Then the return value could simply be (> i l). 07:04:31 nah, too convoluted 07:04:38 Hahaha, then just use a named let. 07:04:39 at least for me :-P 07:04:42 It's much better for your sanity. 07:04:46 ok 07:04:55 and a named let works just like a lamda? 07:04:58 Most seasoned Schemers use named let for pretty much all their looping. 07:06:07 The named thingy is a lambda, yes. 07:06:30 ok 07:07:47 btw. In case you didn't know: instead of typing a narrative in your current format (*nods*, *checks*) you can also use the /me command. Just type in (without quotes) "/me narrates". 07:08:52 -!- realitygrill [~realitygr@adsl-76-226-114-237.dsl.sfldmi.sbcglobal.net] has quit [Quit: realitygrill] 07:11:02 Lol. 07:11:24 doomrobo: I hate using /me when it's a single word. 07:11:36 oh, ok 07:11:37 araujo [~araujo@190.73.44.29] has joined #scheme 07:11:37 -!- araujo [~araujo@190.73.44.29] has quit [Changing host] 07:11:37 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 07:11:44 I wasn't sure if you knew it or not 07:12:00 doomrobo: Hahahaha. (I've been using IRC since 1997, just for the record. :-P) 07:12:02 *doomrobo* feels stupid, now 07:12:08 No worries. :-) 07:12:31 wow, now my code goes through an infinite loop 07:12:39 Lovely. :-P 07:13:15 if I write (if (> i l) #t) it should return #t, right? 07:13:59 I think you are thinking of "return" in the conext of imperative languages. Scheme doesn't have that notion of "return". :-) 07:14:00 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 260 seconds] 07:14:09 well, yeah 07:14:15 so it evaluates to #t? 07:14:33 Right, but if you have code after it, then that #t will be forgotten/discarded. 07:14:41 oh 07:15:13 doomrobo: Have you programmed in, say, Ruby, or R, or something like it? 07:15:45 If so, think of writing a function in Ruby, only, the "return" keyword doesn't exist. 07:15:59 So whatever you want to return, you must arrange for it to be the last expression in the function. 07:16:00 I'm a C/C++ person 07:16:05 Ah. 07:16:20 Well, in Ruby or Scheme, the last expression in a function is implicitly what gets returned. 07:16:50 There is no "return" in Scheme (unless you're using continuations, and I'm not touching that topic today). 07:17:11 then I think I'll stay away from it 07:17:17 (return, that is) 07:17:20 :-) 07:17:59 I'm having a terrible time trying to get a good understanding of continuations 07:17:59 So, Scheme really exemplifies the "only one point of return" concept. :-) 07:18:32 pyro-: Have you ever used setjmp/longjmp, or exceptions, or anything like that? If so, that's sort of the tip of the continuation iceberg. 07:19:18 cky I'm not sure how to program this: http://pastebin.com/8w0XfSYC 07:19:43 doomrobo: You're soooooo close!! 07:19:53 doomrobo: Have you used cond before? 07:19:54 yeah. but they are far less magical seeming. why didn't they explain them in the wizard book where first i learnt the rest of scheme from :( 07:20:06 cky I know how to use it 07:20:10 pyro-: Continuations are far more powerful than setjmp/longjmp. 07:20:20 ohhhh 07:20:21 ok 07:20:56 doomrobo: I take it you got it, then. :-) 07:21:35 doomrobo: BTW, the code you pasted is the standard reasoning Racket people give as to why they forbid one-armed ifs. 07:21:47 doomrobo: Because it too frequently gets misused, as demonstrated in your example. :-) 07:21:50 yes i'm aware. i've seen plenty of examples. i just don't feel i understand the motivation, or when to use them, or how they work. 07:22:08 pyro-: eli has written an article about it here: http://pl.barzilay.org/lec27.txt 07:22:14 jjong [~user@58.225.5.42] has joined #scheme 07:22:23 Oops. 07:22:31 I see 07:22:41 wingo [~wingo@90.164.198.39] has joined #scheme 07:23:49 It's been pulled. :-O And only a day or two ago, it was still there. 07:24:42 Well, I have a local mirrored copy. 07:24:49 people conspiring against me so i will never learn it :( 07:25:02 Awwww.... 07:25:32 cky: Yeah, preparing for a new semester. 07:25:41 eli: Haha, nice. 07:25:48 eli: Would you be okay with me sending pyro- my local copy? 07:26:19 cky: Sure, but easier: http://tmp.barzilay.org/tmp/cont.txt 07:26:28 :-) 07:26:38 Um... 07:26:43 http://tmp.barzilay.org/cont.txt 07:27:14 thank you cky/eli! 07:27:48 :-) 07:28:53 cky IT WORKS! 07:28:55 finally 07:29:13 so cond *isn't* equal to multiple if's 07:29:26 that's the C thinking for me 07:29:44 -!- wingo [~wingo@90.164.198.39] has quit [Quit: Leaving] 07:31:02 doomrobo: cond is like a big if/elseif thingy. 07:31:33 ah, a thingy, gotcha :-) 07:31:34 doomrobo: Whereas multiple ifs (as you had it) are like, in C terms, a bunch of ifs with no elses. 07:31:38 Yes. 07:33:53 -!- rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has quit [Remote host closed the connection] 07:36:41 -!- doomrobo [~michael@187.141.68.34] has quit [Quit: Leaving] 08:16:21 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Ping timeout: 240 seconds] 08:16:45 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 08:22:58 rstandy [~rastandy@93-63-185-248.ip29.fastwebnet.it] has joined #scheme 08:23:20 -!- ASau [~user@93-80-104-193.broadband.corbina.ru] has quit [Quit: off] 08:27:36 has anyone seen weirdo lately? 08:28:50 i mean, i see the mad idle skills of weirdo right now and all 08:29:03 -!- sodel [~dralston_@S0106687f74a12729.va.shawcable.net] has quit [Quit: making nice with my bed sheets.] 08:48:48 masm [~masm@bl15-76-105.dsl.telepac.pt] has joined #scheme 08:51:03 eli: in http://tmp.barzilay.org/cont.txt in the web-code macro, prompt is not used. 08:56:18 amgarching [~matveev@2001:4ca0:2608:0:6ef0:49ff:fe0e:153a] has joined #scheme 09:11:00 MrFahrenheit [~RageOfTho@users-150-228.vinet.ba] has joined #scheme 09:11:36 bokr [~ed@109.110.41.111] has joined #scheme 09:18:13 woonie [~woonie@s50161.pc.nus.edu.sg] has joined #scheme 09:19:25 -!- jjong [~user@58.225.5.42] has quit [Remote host closed the connection] 09:21:30 eli: further down where you define call-k, the second definition doesn't have the second k argument that you mention in the text. 09:24:04 eli: typo: techincalities 09:31:31 Burlingk [~burlingk@softbank221067045171.bbtec.net] has joined #scheme 09:36:57 eli: 'nother typo: sequare 09:43:07 ijp [~user@host109-154-210-10.range109-154.btcentralplus.com] has joined #scheme 09:44:10 -!- woonie [~woonie@s50161.pc.nus.edu.sg] has quit [Ping timeout: 250 seconds] 09:47:39 dettoaltrimenti [~dettoaltr@ppp91-76-232-34.pppoe.mtu-net.ru] has joined #scheme 09:48:41 eli: abbiguous 09:49:11 -!- dettoaltrimenti [~dettoaltr@ppp91-76-232-34.pppoe.mtu-net.ru] has left #scheme 09:52:30 eli: trnsform, is possibly only, happenning, nice read btw! 10:02:17 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has quit [Ping timeout: 240 seconds] 10:02:57 -!- replore_ [~replore@203.152.213.161.static.zoot.jp] has quit [Remote host closed the connection] 10:04:20 mmc [~michal@sams-office-nat.tomtomgroup.com] has joined #scheme 10:10:34 -!- elly [~elly@atheme/member/elly] has quit [Ping timeout: 245 seconds] 10:18:37 elly [~elly@atheme/member/elly] has joined #scheme 10:19:41 leo2007 [~leo@58.22.113.146] has joined #scheme 10:22:51 q: (trace (cons 1 '())) 10:23:02 trace: not an identifier in: (cons 1 (quote ())) 10:25:47 -!- homie` [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 10:26:00 -!- wbooze` [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 10:26:30 serban: which scheme are you using? 10:28:38 wbooze [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 10:28:43 homie [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 10:41:34 -!- acarrico [~acarrico@pppoe-68-142-45-116.gmavt.net] has quit [Remote host closed the connection] 11:05:15 dfjkldfajkl [~paulh@145.120.22.54] has joined #scheme 11:09:50 -!- leppie [~lolcow@196-215-83-98.dynamic.isadsl.co.za] has quit [Read error: Connection reset by peer] 11:14:16 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 11:16:46 leppie [~lolcow@196-215-83-98.dynamic.isadsl.co.za] has joined #scheme 11:27:45 -!- pchrist [~spirit@gentoo/developer/pchrist] has quit [Ping timeout: 260 seconds] 11:29:30 pchrist [~spirit@gentoo/developer/pchrist] has joined #scheme 11:32:22 -!- leo2007 [~leo@58.22.113.146] has quit [Quit: rcirc on GNU Emacs 23.3.50.1] 11:36:51 gravicappa [~gravicapp@80.90.116.82] has joined #scheme 11:39:05 wingo [~wingo@90.164.198.39] has joined #scheme 11:39:47 -!- mmc [~michal@sams-office-nat.tomtomgroup.com] has left #scheme 11:46:04 mmc [~michal@sams-office-nat.tomtomgroup.com] has joined #scheme 11:46:58 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 11:47:11 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping timeout: 240 seconds] 12:06:23 realitygrill [~realitygr@adsl-76-226-114-237.dsl.sfldmi.sbcglobal.net] has joined #scheme 12:10:12 pandeiro [~pandeiro@187.105.250.224] has joined #scheme 12:13:31 Kajtek [~nope@nat4-230.ghnet.pl] has joined #scheme 12:18:04 -!- bokr [~ed@109.110.41.111] has quit [Quit: Leaving.] 12:18:24 G__ [~G@41.51.68.86.rev.sfr.net] has joined #scheme 12:29:49 -!- EM03 [~dfsdfdsf@unaffiliated/em03] has quit [Quit: EM03] 12:38:30 replore [~replore@ntkngw133234.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #scheme 12:43:57 -!- replore [~replore@ntkngw133234.kngw.nt.ftth.ppp.infoweb.ne.jp] has quit [Remote host closed the connection] 12:49:58 xissburg [~xissburg@187.50.13.57] has joined #scheme 12:59:02 -!- twem2 [~tristan@puma-mxisp.mxtelecom.com] has quit [Remote host closed the connection] 13:10:44 thoolihan [~Tim@50.51.57.35] has joined #scheme 13:20:36 woonie [~woonie@nusnet-236-114.dynip.nus.edu.sg] has joined #scheme 13:32:41 -!- PreciousMetals [~Heart@unaffiliated/colours] has quit [Ping timeout: 240 seconds] 13:51:57 rpg [~rpg@mpls.sift.info] has joined #scheme 13:52:14 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 13:53:40 woonie2 [~woonie@nusnet-17-78.dynip.nus.edu.sg] has joined #scheme 13:55:48 -!- woonie [~woonie@nusnet-236-114.dynip.nus.edu.sg] has quit [Ping timeout: 260 seconds] 14:04:12 PreciousMetals [~Heart@unaffiliated/colours] has joined #scheme 14:05:58 -!- homie [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 14:06:09 -!- wbooze [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 14:08:00 homie [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 14:08:31 wbooze [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 14:14:35 EM03 [~dfsdfdsf@cpe-71-72-126-188.insight.res.rr.com] has joined #scheme 14:14:35 -!- EM03 [~dfsdfdsf@cpe-71-72-126-188.insight.res.rr.com] has quit [Changing host] 14:14:35 EM03 [~dfsdfdsf@unaffiliated/em03] has joined #scheme 14:15:26 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has left #scheme 14:22:24 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Quit: Computer has gone to sleep.] 14:27:49 twem2 [~tristan@puma-mxisp.mxtelecom.com] has joined #scheme 14:27:55 -!- twem2 [~tristan@puma-mxisp.mxtelecom.com] has quit [Client Quit] 14:29:06 twem2 [~tristan@puma-mxisp.mxtelecom.com] has joined #scheme 14:30:23 -!- wbooze [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 14:30:43 -!- homie [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 14:34:36 dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has joined #scheme 14:37:25 homie [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 14:38:16 wbooze [~levgue@xdsl-78-35-191-207.netcologne.de] has joined #scheme 14:46:14 -!- dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has quit [Quit: dnolen] 14:47:23 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 14:49:27 rbuck [~rbuck@66-189-68-77.dhcp.oxfr.ma.charter.com] has joined #scheme 14:59:19 -!- ijp [~user@host109-154-210-10.range109-154.btcentralplus.com] has quit [Ping timeout: 245 seconds] 14:59:21 pierreghz [~pierreghz@cust-208-56-111-94.dyn.as47377.net] has joined #scheme 15:04:44 acarrico [~acarrico@pppoe-68-142-45-116.gmavt.net] has joined #scheme 15:05:20 -!- hkBst [~quassel@gentoo/developer/hkbst] has quit [Remote host closed the connection] 15:08:42 arun_rathakrishn [~arun@117.193.157.41] has joined #scheme 15:12:28 ijp [~user@host81-159-126-100.range81-159.btcentralplus.com] has joined #scheme 15:27:14 -!- rbuck [~rbuck@66-189-68-77.dhcp.oxfr.ma.charter.com] has quit [Ping timeout: 245 seconds] 15:33:20 rvn_ [~rvn@77.107.164.131] has joined #scheme 15:34:30 phax [~phax@unaffiliated/phax] has joined #scheme 15:38:40 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 15:40:53 -!- rstandy [~rastandy@93-63-185-248.ip29.fastwebnet.it] has quit [Ping timeout: 258 seconds] 15:53:23 danly|work [~user@216.81.48.202.epikip.net] has joined #scheme 15:56:49 -!- Brendan_T [~brendan@static.112.22.47.78.clients.your-server.de] has quit [Ping timeout: 245 seconds] 15:59:52 -!- homie [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 15:59:59 -!- wbooze [~levgue@xdsl-78-35-191-207.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 16:01:18 MichaelRaskin [~MichaelRa@195.91.224.225] has joined #scheme 16:06:24 jonrafkind [~jon@jonr5.dsl.xmission.com] has joined #scheme 16:13:11 -!- woonie2 [~woonie@nusnet-17-78.dynip.nus.edu.sg] has quit [Ping timeout: 240 seconds] 16:14:59 pumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 16:15:11 woonie [~woonie@nusnet-236-114.dynip.nus.edu.sg] has joined #scheme 16:15:26 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Ping timeout: 240 seconds] 16:18:48 -!- DGASAU [~user@91.218.144.129] has quit [Read error: No route to host] 16:22:05 DGASAU [~user@91.218.144.129] has joined #scheme 16:23:02 -!- DGASAU [~user@91.218.144.129] has quit [Remote host closed the connection] 16:24:18 -!- pandeiro [~pandeiro@187.105.250.224] has quit [Quit: Thanks, fellas] 16:24:20 DGASAU [~user@91.218.144.129] has joined #scheme 16:31:24 -!- pumpkin is now known as copumpkin 16:33:41 smtlaissezfaire_ [~smtlaisse@h26.160.216.66.static.ip.windstream.net] has joined #scheme 16:36:01 blueadept [~blueadept@unaffiliated/blueadept] has joined #scheme 16:36:17 is there a reason why mit-scheme takes so long to compile? 16:36:28 i mean come on 16:37:34 its been about 30 minutes so far 16:48:25 -!- smtlaissezfaire_ [~smtlaisse@h26.160.216.66.static.ip.windstream.net] has quit [Quit: smtlaissezfaire_] 16:49:20 arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has joined #scheme 16:51:50 -!- ijp [~user@host81-159-126-100.range81-159.btcentralplus.com] has quit [Ping timeout: 240 seconds] 16:53:47 -!- Kajtek [~nope@nat4-230.ghnet.pl] has quit [Quit: Leaving.] 16:55:26 Kajtek [~nope@nat4-230.ghnet.pl] has joined #scheme 17:06:06 tupi [~david@139.82.89.24] has joined #scheme 17:06:08 -!- gravicappa [~gravicapp@80.90.116.82] has quit [Remote host closed the connection] 17:06:44 -!- pchrist [~spirit@gentoo/developer/pchrist] has quit [Quit: leaving] 17:07:24 pchrist [~spirit@gentoo/developer/pchrist] has joined #scheme 17:14:48 pandeiro [~pandeiro@187.105.250.224] has joined #scheme 17:16:15 -!- amoe [~amoe@cpc3-brig16-2-0-cust858.3-3.cable.virginmedia.com] has quit [Ping timeout: 276 seconds] 17:17:28 -!- thoolihan [~Tim@50.51.57.35] has quit [Ping timeout: 264 seconds] 17:24:35 -!- blueadept [~blueadept@unaffiliated/blueadept] has left #scheme 17:25:36 nego [~nego@c-76-16-30-244.hsd1.il.comcast.net] has joined #scheme 17:33:57 ijp [~user@host109-154-209-241.range109-154.btcentralplus.com] has joined #scheme 17:34:44 -!- realitygrill [~realitygr@adsl-76-226-114-237.dsl.sfldmi.sbcglobal.net] has quit [Ping timeout: 245 seconds] 17:36:05 realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has joined #scheme 17:40:37 blueadept: The Force, of course, takes a while to compile. 17:40:46 rgrinberg [~rudi@CPE001839b36a63-CM0016923fe746.cpe.net.cable.rogers.com] has joined #scheme 17:47:24 turbofail [~user@c-107-3-149-149.hsd1.ca.comcast.net] has joined #scheme 17:50:42 -!- MichaelRaskin [~MichaelRa@195.91.224.225] has quit [Ping timeout: 276 seconds] 17:59:48 pumpkin [~pumpkin@17.45.135.33] has joined #scheme 17:59:53 -!- pumpkin [~pumpkin@17.45.135.33] has quit [Changing host] 17:59:53 pumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 18:00:12 -!- pumpkin is now known as copumpkin_ 18:01:35 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Disconnected by services] 18:01:39 -!- copumpkin_ is now known as copumpkin 18:13:43 -!- realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has quit [Quit: realitygrill] 18:14:29 realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has joined #scheme 18:15:22 -!- arun_rathakrishn [~arun@117.193.157.41] has quit [Ping timeout: 258 seconds] 18:15:23 MichaelRaskin [~MichaelRa@195.91.224.225] has joined #scheme 18:28:51 -!- wingo [~wingo@90.164.198.39] has quit [Ping timeout: 246 seconds] 18:44:05 HG` [~HG@p579F7706.dip.t-dialin.net] has joined #scheme 18:47:55 fizzie [fis@iris.zem.fi] has joined #scheme 18:52:50 -!- githogori [~githogori@c-24-7-1-43.hsd1.ca.comcast.net] has quit [Ping timeout: 260 seconds] 18:55:56 -!- cbrannon [~cbrannon@gentoo/developer/cbrannon] has quit [Ping timeout: 264 seconds] 19:03:03 cbrannon [~cbrannon@gentoo/developer/cbrannon] has joined #scheme 19:11:32 hkBst: all fixed. 19:11:41 rudybot: seen minion? 19:11:42 eli: No sign of minion? 19:11:45 rudybot: seen minion 19:11:46 eli: minion was seen joining in/on #scheme six weeks ago, and then minion was seen quitting in/on tiger.common-lisp.net six weeks ago, saying "Ping timeout: 246 seconds" 19:14:40 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Remote host closed the connection] 19:15:05 Riastradh [~riastradh@fsf/member/riastradh] has joined #scheme 19:15:17 It would be great if someone could extend rudybot to cover minion's job. 19:16:43 amoe [~amoe@cpc3-brig16-2-0-cust858.3-3.cable.virginmedia.com] has joined #scheme 19:18:46 smtlaissezfaire_ [~smtlaisse@h26.160.216.66.static.ip.windstream.net] has joined #scheme 19:31:14 bgs100 [~ian@unaffiliated/bgs100] has joined #scheme 19:32:06 what is that word/phrase we use to describe how scheme passes the results directly to the new continuation? 19:32:17 call continuation? 19:35:03 -!- arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has quit [Read error: Connection reset by peer] 19:36:24 I think it is continuation passing style 19:49:03 preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #scheme 19:53:50 -!- mmc [~michal@sams-office-nat.tomtomgroup.com] has quit [Ping timeout: 240 seconds] 19:57:35 -!- smtlaissezfaire_ [~smtlaisse@h26.160.216.66.static.ip.windstream.net] has quit [Ping timeout: 260 seconds] 19:58:15 -!- nego [~nego@c-76-16-30-244.hsd1.il.comcast.net] has quit [Quit: leaving] 20:02:20 -!- realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has quit [Read error: Connection reset by peer] 20:02:41 realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has joined #scheme 20:04:37 -!- cbrannon [~cbrannon@gentoo/developer/cbrannon] has quit [Ping timeout: 258 seconds] 20:06:24 -!- woonie [~woonie@nusnet-236-114.dynip.nus.edu.sg] has quit [Ping timeout: 245 seconds] 20:10:56 -!- MrFahrenheit [~RageOfTho@users-150-228.vinet.ba] has quit [Read error: Connection reset by peer] 20:11:18 MrFahrenheit [~RageOfTho@users-150-228.vinet.ba] has joined #scheme 20:12:51 -!- kennyd [~kennyd@78-1-177-107.adsl.net.t-com.hr] has quit [Read error: Connection reset by peer] 20:14:47 -!- sjamaan [~sjamaan@netbsd/developer/sjamaan] has quit [Ping timeout: 252 seconds] 20:15:14 stamourv: Most of the code is there, but I think that offby1 really liked my hack... 20:15:41 sjamaan [~sjamaan@frohike.xs4all.nl] has joined #scheme 20:15:41 -!- sjamaan [~sjamaan@frohike.xs4all.nl] has quit [Changing host] 20:15:41 sjamaan [~sjamaan@netbsd/developer/sjamaan] has joined #scheme 20:16:01 kennyd [~kennyd@78-1-177-107.adsl.net.t-com.hr] has joined #scheme 20:17:07 cbrannon [~cbrannon@gentoo/developer/cbrannon] has joined #scheme 20:18:43 eli: The hack being outsourcing to minion? 20:18:51 Yes. 20:19:13 I don't know if offby1 likes it as much now ;). 20:21:53 realitygrill_ [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has joined #scheme 20:23:18 -!- realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has quit [Read error: Connection reset by peer] 20:23:18 -!- realitygrill_ is now known as realitygrill 20:42:50 ASau [~user@93-80-104-193.broadband.corbina.ru] has joined #scheme 20:56:04 rbuck [~rbuck@mobile-198-228-199-089.mycingular.net] has joined #scheme 20:56:50 -!- kennyd [~kennyd@78-1-177-107.adsl.net.t-com.hr] has quit [Read error: Connection reset by peer] 20:57:38 thoolihan [~Tim@50.51.57.35] has joined #scheme 21:03:31 kennyd [~kennyd@93-138-98-69.adsl.net.t-com.hr] has joined #scheme 21:06:24 -!- Riastradh [~riastradh@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 21:09:23 drdo [~drdo@91.205.108.93.rev.vodafone.pt] has joined #scheme 21:10:49 doomrobo [~michael@187.141.68.34] has joined #scheme 21:11:42 -!- rbuck [~rbuck@mobile-198-228-199-089.mycingular.net] has quit [Quit: rbuck gone away...] 21:13:48 I'm trying to write a function to return a list of (x) amount of sequential primes, but it's infinilooping. I'm trying to get used to the "return value" / "last evaluated term" thing and I thought I wrote this correctly, but apparently not. http://codepad.org/QPw6gqNW 21:19:25 Eep, what's with the formatting? And why have you mixed an IF and some nested CONDs? 21:19:37 *fds* works to make it readable. 21:20:11 I'm new, and a C/C++ programmer 21:20:29 sorry about that, I can't force myself to use any other way 21:21:08 -!- realitygrill [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has quit [Read error: Connection reset by peer] 21:21:13 realitygrill_ [~realitygr@adsl-76-232-155-131.dsl.sfldmi.sbcglobal.net] has joined #scheme 21:25:52 Oh, I see what's going on now, you're relying on the side-effect of the IF statement. 21:26:24 yeah, and the cond is always evaluated 21:26:50 This is terrible. :-) 21:28:17 If I were you, I'd pass the list of primes as another argument to the PRIME function. 21:28:18 sodel [~dralston_@S0106687f74a12729.va.shawcable.net] has joined #scheme 21:28:23 Well, then, I have to show you my (is-prime?) function, I'm sure you'll like that muuuuch better :-) 21:28:31 Heh 21:29:06 why would you do that? 21:30:01 Because then you don't need to mutate anything. 21:30:14 It tastes nicer. 21:30:23 I do, the list 21:30:37 Which list? 21:30:48 of primes 21:30:56 You can just pass a new list each time you recurse. 21:31:14 Made from the old list and any new primes you've found in the mean time. :-) 21:31:30 That's what I'm doing 21:32:57 It doesn't look like that to me.. 21:33:21 I'm calling (loop primes (+ current 2)) 21:33:34 I'm passing primes back to the function 21:35:39 I have no clue what you mean. Can you restate what changes you think I should make? 21:35:46 doomrobo: the reason you get an infinite loop, is because 'append' doesn't mutate the list. 21:36:12 so the primes list is always empty 21:36:43 oh 21:36:51 how do I mutate the list, then? 21:36:58 use set! 21:37:16 well you don't have to yell :-P 21:37:49 I'm so confused by this code, and I suck at being intelligently helpful. I can however write what I'd do in this situation, if that might help. :-) 21:38:00 sure 21:38:19 I'll try to fix it ijp's way and then I'll post my (is-prime?) function that works 21:38:39 -!- sodel [~dralston_@S0106687f74a12729.va.shawcable.net] has quit [Quit: Leaving] 21:39:24 i really want to view this code but codepad dislikes me right now 21:39:38 I'll repost on pastebin 21:39:51 but I've already made changes 21:39:58 also, you don't want to call (primes), as it is not a function 21:40:33 http://pastebin.com/49UwnYQB 21:41:07 doomrobo: You don't need to mutate the list. 21:41:30 Instead, where you do the append, define a new list to be the result of the call to append. 21:41:38 Append returns a new list. 21:42:12 Then, wherever you would use the `primes' list, use the new list instead, it will have the new elements. 21:42:13 I get it now 21:42:42 But I'd rather mutate the list, it makes more sense to me 21:42:46 -!- Nisstyre [~yours@infocalypse-net.info] has quit [Quit: Leaving] 21:42:46 lemme try the new code 21:43:08 Also, re formatting, I suggest using emacs (or DrRacket), it will format your code for you, so you won't even have to think about it. 21:43:32 that word shan't be uttered in my place of dwelling! 21:43:53 doomrobo: You can stick to your old habits, but by trying to do it the Scheme way, you will probably learn interesting things along the way. 21:44:03 ok 21:44:16 btw, it seems to work but I get an "not applicable" error 21:44:22 s/an/a/ 21:44:31 primes isn't a function, but you call it as one 21:44:36 Avoiding side effects makes it easier to reason about functions, which is great when debugging. 21:44:41 I defined it as a lambda 21:44:59 `prime' is a lambda, `primes' is not. 21:45:09 I'm calling prime 21:45:20 Line 7. 21:45:48 yeah, I'm evaluating a list 21:45:55 why isn't it applicable 21:45:57 it's a list 21:46:03 because it isn't a function 21:46:23 so how do I make it show a list when I call (prime)? 21:46:39 Just return the list. 21:46:50 how do I do that? 21:46:53 ((= (length primes) x) (primes)) should be ((= (length primes) x) primes) 21:46:55 Just referencing `prime', without calling it. 21:47:05 oooohhhhh 21:47:07 ok 21:47:07 notice that there are two less parentheses 21:47:17 I didn't notice that 21:47:44 ok, it works 21:48:01 now, how do I not mutate the list but recursively append it? 21:48:20 it's (loop (append primes current) (current)) 21:48:25 with if's, of course 21:48:30 right? 21:49:13 Got it. 21:49:16 -!- tupi [~david@139.82.89.24] has quit [Quit: Leaving] 21:49:20 But without the parens arounbd `current'. 21:49:33 s/arounbd/around 21:49:33 right 21:52:44 Is there no way of doing this without a shitload of nested conds? 21:53:51 are you duplicating the appends everywhere? 21:54:18 doomrobo: `cond' can have as many branches as you want. 21:54:43 ijp I don't know what you mean 21:54:58 rudybot: (cond [(number? "3") 'nope] [(number? "2") 'still-not] [else 'I-give-up]) 21:55:00 stamourv: your typed/racket sandbox is ready 21:55:00 stamourv: ; Value: I-give-up 21:56:06 doomrobo: nvm, I may have misunderstood 21:59:11 -!- pandeiro [~pandeiro@187.105.250.224] has quit [Quit: Thanks, fellas] 22:00:34 -!- xissburg [~xissburg@187.50.13.57] has quit [Remote host closed the connection] 22:00:42 testing my (uglier) code now 22:01:02 bzzbzz [~franco@modemcable240.34-83-70.mc.videotron.ca] has joined #scheme 22:01:18 that's weird: "the object #f isn't applicable" 22:02:57 wow, to may indents it doesn't fit on a page: http://pastebin.com/BEF2vPFi 22:03:11 s/to/so/ 22:03:51 Schemers usually use 2-character tabs for that reason. 22:04:00 makes sense 22:04:22 If you don't like that editor whose name starts with an e, you can use DrRacket, it will also indent your code. 22:04:34 And maybe there's something for vi, if that's what you prefer. 22:05:24 To factor out some of the repetition, you can give a name to `(append primes current)'. 22:05:27 vim, and I've seen some indenters, but I don't likeit 22:05:47 ok 22:06:00 Or even do something like `(define new-primes (if primality (append primes current) primes))' 22:06:20 and use `new-primes' where you use either `(append ...)' or `primes' below. 22:06:47 ok 22:06:54 After that, you can merge all your conditionals into one. 22:06:57 Something like: 22:07:14 but that's re-evaluating the same code 22:07:56 (cond ((= length ...) primes) ((= current 2) (loop ...)) (else ...)) 22:08:06 What do you mean re-evaluating? 22:08:14 I'm confusing myself 22:08:19 lemme see if I can do it that way 22:10:05 why is it bad practice to mutate primes? 22:10:28 Mutation makes it harder to reason about your program. 22:10:43 Let's say you're debugging. 22:10:43 I suppose it makes sense in a bigger function 22:11:04 oh, I see: every level has its own value 22:11:10 You'd like to be able to assume that the result of the function depends only on its input, and not on some hidden piece of state. 22:11:12 no changing in the middle 22:11:21 What do you mean? 22:11:57 every level of recursion of a function without mutation keeps a variable at a certain value only to be changed upon the next "push" 22:15:30 -!- HG` [~HG@p579F7706.dip.t-dialin.net] has quit [Quit: HG`] 22:15:51 You're doing tail recursion. 22:16:03 The last thing you do in the function is recur. 22:16:09 yes 22:16:27 There's no need to keep the previous stack frame. 22:16:56 A conformant Scheme system will use constant stack space. 22:17:40 I'm not talking about stack, I'm just saying the metaphorical "push" into the next level of recursion. I've been reading GEB. 22:19:58 Right. 22:23:57 This doesn't work, and sorry about the indentation, pastebin doesn't let me change it: http://pastebin.com/zns66F4W 22:26:07 Two things. 22:26:37 First, in your definition of `new-prime', you quote the right hand side, with "'". 22:26:47 That turns it into a list, it's not code anymore. 22:27:07 -!- pierreghz [~pierreghz@cust-208-56-111-94.dyn.as47377.net] has quit [Quit: Quitte] 22:27:18 Second, you refer to an `updated-primes' variable, but it's never defined. 22:27:29 ok, that makes sense 22:27:56 how do I define it without it evaluating? I thought that's what ' is for 22:28:12 My guess is that your definition for `new-prime' would be a good candidate for `updated-primes'. But, that definition only makes sense after the definition of `divisibility', since `new-prime' refers to it. 22:28:49 "'" is for creating data. If you want code, but don't want to evaluate it, put it in a lambda. It will evaluate when you call the lambda. 22:29:24 But in this case, you're referring to `divisibility' before it's defined, so evaluated or not, it won't work. 22:30:21 so what do I do, doctor? 22:30:36 -!- rpg [~rpg@mpls.sift.info] has quit [Quit: rpg] 22:33:18 -!- Urchin [~urchin@unaffiliated/urchin] has left #scheme 22:33:30 -!- moll [~user@150.181.35.213.dyn.estpak.ee] has quit [Ping timeout: 246 seconds] 22:38:38 Well, you can define `updated-primes', using the code from `new-prime'. 22:38:48 that's what I did, it was a typo 22:39:05 but how do I define it before divisibility is defined? 22:39:15 Then you need to put the definition in a place where it has access to all the info it needs. 22:39:45 I thought defining something using a quote means that it won't be evaluated until it's used 22:39:47 Why do you want to define it before `divisibility'? 22:40:08 so it doesn't define the same thing every loop iteration 22:40:11 moll [~user@150.181.35.213.dyn.estpak.ee] has joined #scheme 22:40:18 No, that would be laziness, and it's unrelated to what we're doing now. 22:40:29 It won't define the same thing each loop iteration. 22:40:36 jrapdx_ [~chatzilla@c-98-246-157-58.hsd1.or.comcast.net] has joined #scheme 22:40:41 Each iteration, `primes' may be something different. 22:41:07 and current and divisibility 22:41:14 If it's not, nothing new will be re-evaluated, since we'll just reuse the `primes' we already have. 22:41:34 `current' and `divisibility' will be different too, that's right. 22:41:36 -!- jrapdx_ [~chatzilla@c-98-246-157-58.hsd1.or.comcast.net] has quit [Client Quit] 22:41:51 Which means that `new-prime' should be different as well, since it depends on them. 22:42:32 So putting the definition inside the loop makes sense. 22:44:01 ok 22:44:31 it still returns #f isn't applicable 22:44:48 Show me what you wrote. 22:44:59 kk 22:45:32 -!- jrapdx [~jra@c-98-246-157-58.hsd1.or.comcast.net] has quit [Quit: Leaving] 22:45:42 http://codepad.org/Y6hHawJc 22:46:07 arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has joined #scheme 22:46:19 -!- arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has quit [Remote host closed the connection] 22:46:30 arcfide [1000@c-69-136-7-94.hsd1.in.comcast.net] has joined #scheme 22:47:50 What Scheme system are you using. The error message you get is correct, but awfully unfriendly. 22:48:07 mit-scheme 22:48:29 jrapdx [~chatzilla@c-98-246-157-58.hsd1.or.comcast.net] has joined #scheme 22:48:49 I recommend Racket. It even has built-in languages for beginners, that are geared towards producing good error messages. 22:49:00 As for the current error message, look at line 6. 22:49:12 Parentheses mean function call. 22:49:34 You're trying to call the result of a call to `=', which is a boolean. 22:49:51 The double parentheses work for `cond', but not for `if'. 22:50:22 `cond''s structure goes like that: `(cond ( ) ...)' 22:50:26 Hence the extra parens. 22:50:50 `if''s structure goes like this: `(if )'. 22:50:53 ok, so I removed the extra parenthesis and now I get "argument to append not a list" 22:50:53 No extra parens. 22:51:18 Good, we're making progress. 22:51:28 `append' takes two lists, and appends them. 22:51:32 What are you giving it? 22:52:20 not a list 22:53:16 got it 22:53:24 I don't know if it was the list problem 22:53:33 I just forgot to remove the extra parens around the other ifs 22:54:11 Well, you're passing `current', a number, to `append'. That won't work. 22:54:29 it did, surprisingly 22:54:35 I've experimented with it before 22:54:44 it returns a cons when it's not a list 22:55:18 Scratch that, it will work, but it probably won't give you what you want. 22:55:23 it doesn't 22:55:24 rudybot: init racket 22:55:24 stamourv: your sandbox is ready 22:55:40 rudybot: (append (list 1 2 3) 4) 22:55:40 stamourv: ; Value: (1 2 3 . 4) 22:55:46 That's not a list anymore. 22:55:50 cons 22:55:55 rudybot: (append (list 1 2 3) (list 4)) 22:55:55 stamourv: ; Value: (1 2 3 4) 22:56:02 That's a list. 22:56:13 but a list is technically a specially formatted cons 22:56:18 But I understand 22:56:27 Now can you explain that quote problem again? 22:57:13 Quote is a way of saying: take the next expression, and treat it as data. 22:57:21 rudybot: '(1 2 3 hello) 22:57:21 stamourv: ; Value: (1 2 3 hello) 22:57:28 I get that 22:57:29 oh 22:57:31 Here, we get a list with 4 elements. 22:57:35 now I understand why I can't use it 22:57:38 It's not code anymore. 22:57:48 ok 22:58:02 so I'm popping out of the system when I just really have to define it in terms of something else 22:58:23 ? 22:58:30 again, GEB 22:58:34 GEB? 22:58:42 Godel Escher Bach 22:58:45 Ah. 22:58:52 that may be completely wrong, but that's how it just came to me 22:59:15 Anyway, I have to leave soon, but two things before I go. 22:59:23 so scheme knows when something shouldn't be defined a million times? 22:59:29 ok 22:59:46 Your solution uses append. Since you need to find the end of the first list to append the second, it takes O(n). 23:00:04 yes 23:00:17 mjonsson [~mjonsson@38.109.95.133] has joined #scheme 23:00:25 The canonical Scheme solution is to build the list backwards, `cons'ing each new element to the front, then `reverse'ing before returning the final result. 23:00:50 isn't that the same complexity? 23:00:50 Since `cons' takes O(1), that's more efficient. 23:00:54 No. 23:01:23 With `append', you `append' each time around the loop. You end up with O(n^2). 23:01:53 I don't get it, but I'll think about it 23:01:58 With `cons', each time around the loop, you `cons' in O(1), and then reverse once at the end. You end up with O(n). 23:02:11 They key is that you only reverse once at the end, not each time around. 23:02:32 Second thing, you should go read HTDP (How to Design Programs). 23:02:35 so it's just a matter of append vs cons 23:02:40 ok 23:02:51 so scheme knows when you are redefining the same thing? 23:02:54 It's a great book, available for free, that will teach you how to think functionally. 23:03:17 The second edition is here: http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html 23:03:39 It's not complete yet, but it's nicer than the first edition, which is available at htdp.org. 23:03:40 thank you 23:04:05 Have fun with that! 23:04:07 Going now. 23:04:11 c ya 23:04:15 and thank you 23:07:22 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Quit: Computer has gone to sleep.] 23:07:37 -!- doomrobo [~michael@187.141.68.34] has quit [Quit: Leaving] 23:24:00 wisey [~Steven@host86-179-142-217.range86-179.btcentralplus.com] has joined #scheme 23:29:52 -!- danly|work [~user@216.81.48.202.epikip.net] has quit [Read error: Connection reset by peer] 23:30:06 asynchrony [~user@adsl-98-65-191-13.dab.bellsouth.net] has joined #scheme 23:30:58 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 23:31:47 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 23:35:20 jao [~user@pdpc/supporter/professional/jao] has joined #scheme 23:42:12 -!- mjonsson [~mjonsson@38.109.95.133] has quit [Remote host closed the connection] 23:47:26 -!- Hydr4 [~Lernaean@24-107-60-232.dhcp.stls.mo.charter.com] has quit [Read error: Connection reset by peer] 23:50:13 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 260 seconds] 23:58:20 dnolen [~davidnole@cpe-98-14-92-234.nyc.res.rr.com] has joined #scheme