00:04:30 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 00:04:56 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 00:05:22 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 00:10:23 -!- jonrafkind [~jon@crystalis.cs.utah.edu] has quit [Ping timeout: 265 seconds] 00:15:41 -!- Euthydemus` [~euthydemu@vaxjo3.23.cust.blixtvik.net] has quit [Quit: leaving] 00:16:10 Euthydemus [~euthydemu@vaxjo3.23.cust.blixtvik.net] has joined #scheme 00:16:59 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 612 seconds] 00:17:00 jonrafkind [~jon@crystalis.cs.utah.edu] has joined #scheme 00:17:27 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 00:18:25 -!- kuribas [~user@d54C2ADD9.access.telenet.be] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 00:29:02 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 00:29:26 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 00:37:35 -!- RageOfThou [~RageOfTho@users-33-97.vinet.ba] has quit [Ping timeout: 255 seconds] 00:40:14 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 00:40:40 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 00:51:45 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 600 seconds] 00:52:35 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 00:56:23 -!- rdd [~user@c83-250-48-164.bredband.comhem.se] has quit [Ping timeout: 245 seconds] 00:57:04 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 265 seconds] 00:58:13 -!- gravicappa [~gravicapp@ppp85-141-167-181.pppoe.mtu-net.ru] has quit [Ping timeout: 265 seconds] 00:59:29 -!- Modius__ [~Modius@cpe-70-123-158-125.austin.res.rr.com] has quit [Quit: I'm big in Japan] 00:59:54 Modius [~Modius@cpe-70-123-158-125.austin.res.rr.com] has joined #scheme 01:00:37 josephholsten [~josephhol@wsip-70-184-159-102.ok.ok.cox.net] has joined #scheme 01:01:50 -!- jonrafkind [~jon@crystalis.cs.utah.edu] has quit [Ping timeout: 260 seconds] 01:03:24 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 600 seconds] 01:04:36 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 01:14:08 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 01:16:06 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 01:16:31 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 01:17:18 -!- dfkjjkfd [~paulh@238-9-ftth.onsnetstudenten.nl] has quit [Quit: Lost terminal] 01:21:02 -!- josephholsten [~josephhol@wsip-70-184-159-102.ok.ok.cox.net] has quit [Ping timeout: 264 seconds] 01:23:09 -!- Fare [~Fare@64.119.159.126] has quit [Quit: Leaving] 01:27:30 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 615 seconds] 01:28:28 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 01:38:19 -!- turbofail [~user@adsl-99-50-22-193.dsl.pltn13.sbcglobal.net] has quit [Remote host closed the connection] 01:40:00 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 01:40:27 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 01:51:20 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 612 seconds] 01:52:19 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 01:55:56 -!- jao [~user@83.32.170.229] has quit [Remote host closed the connection] 02:00:23 jao [~jao@83.32.170.229] has joined #scheme 02:03:32 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 612 seconds] 02:04:22 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 02:06:08 hiyuh [~hiyuh@KD124214245222.ppp-bb.dion.ne.jp] has joined #scheme 02:06:36 -!- pavelludiq [~quassel@91.139.196.22] has quit [Remote host closed the connection] 02:08:56 -!- chemuduguntar [~user@smtp.touchcut.com] has quit [Ping timeout: 255 seconds] 02:09:54 kenjin2201 [~kenjin@61.99.46.4] has joined #scheme 02:15:01 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 600 seconds] 02:16:14 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 02:22:46 -!- vu3rdd [~vu3rdd@122.167.93.211] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 02:27:34 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 02:28:01 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 02:39:26 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 612 seconds] 02:39:39 -!- abstractj [~shadow_wa@187.56.174.29] has quit [Remote host closed the connection] 02:39:55 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 02:42:23 abstractj [~shadow_wa@187.56.174.29] has joined #scheme 02:43:25 -!- tokam [~tokam@p57B8F511.dip.t-dialin.net] has left #scheme 02:48:19 -!- tupi [~david@186.205.37.15] has quit [Quit: Leaving] 02:49:49 -!- bgs100 [~ian@unaffiliated/bgs100] has quit [Quit: nighty night] 02:51:19 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 02:51:45 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 03:02:50 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 612 seconds] 03:03:40 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 03:04:00 teurastaja [~netwalker@modemcable198.138-200-24.mc.videotron.ca] has joined #scheme 03:09:13 phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has joined #scheme 03:14:20 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 600 seconds] 03:15:19 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 03:19:05 -!- DrDuck [~duck@146.229.116.89] has quit [Ping timeout: 276 seconds] 03:26:26 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 624 seconds] 03:27:02 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 03:27:13 -!- phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has quit [Ping timeout: 250 seconds] 03:28:36 bzzbzz [~franco@modemcable240.34-83-70.mc.videotron.ca] has joined #scheme 03:30:05 -!- kenjin2201 [~kenjin@61.99.46.4] has quit [Ping timeout: 245 seconds] 03:37:44 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 600 seconds] 03:38:35 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 03:45:49 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 03:49:45 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 03:50:11 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 03:52:22 -!- timj [~timj@e176194086.adsl.alicedsl.de] has quit [Read error: Connection reset by peer] 03:52:35 timj [~timj@e176193220.adsl.alicedsl.de] has joined #scheme 04:01:42 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 04:02:08 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 04:08:30 -!- imran_sr [~imran@75-18-254-4.lightspeed.uncyca.sbcglobal.net] has quit [Quit: Leaving] 04:11:56 -!- mmc [~michal@cs27120227.pp.htv.fi] has quit [Quit: Leaving.] 04:12:15 mmc [~michal@cs27120227.pp.htv.fi] has joined #scheme 04:13:13 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Read error: Connection reset by peer] 04:13:37 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 04:24:37 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 619 seconds] 04:25:22 niko [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 04:36:00 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Ping timeout: 600 seconds] 04:43:58 -!- mmc [~michal@cs27120227.pp.htv.fi] has quit [Read error: Connection reset by peer] 04:44:06 mmc [~michal@cs27120227.pp.htv.fi] has joined #scheme 04:44:56 DrDuck [~duck@adsl-81-91-116.hsv.bellsouth.net] has joined #scheme 05:07:05 vu3rdd [~vu3rdd@nat/cisco/x-ulwokobiaqwolvab] has joined #scheme 05:11:54 How would I go about converting something like.. (a . b) -> (cons (quote a) (quote b)) 05:13:44 Axsuul: What is the purpose of such an operation? 05:13:53 -!- teurastaja [~netwalker@modemcable198.138-200-24.mc.videotron.ca] has quit [Ping timeout: 245 seconds] 05:18:17 cky: to have it so expressions can be evaluated in different variations of scheme 05:18:52 But, you can just say '(a . b) in _any_ Scheme and get such a dotted-pair. 05:19:12 cky: its part of an exercise 05:21:05 Like, homework? :-P 05:22:18 cky: erm.. sorta.. yes (blush) 05:22:55 Maxel [~Maxel@adsl-99-72-124-152.dsl.euclwi.sbcglobal.net] has joined #scheme 05:22:55 not looking for a solution, a hint 05:24:07 -!- Maxel [~Maxel@adsl-99-72-124-152.dsl.euclwi.sbcglobal.net] has left #scheme 05:32:11 -!- pumpkin_ [~pumpkin@user-142hbak.cable.mindspring.com] has quit [Quit: Computer has gone to sleep.] 05:33:26 jonrafkind [~jon@jonr5.dsl.xmission.com] has joined #scheme 05:37:17 rudybot: give Axsuul mutable 05:37:18 Axsuul: cky has given you a value, say "rudybot: eval (GRAB)" to get it (case sensitive) 05:38:07 rudybot: eval (GRAB) 05:38:09 Axsuul: your sandbox is ready 05:38:09 Axsuul: ; Value: # 05:38:36 Axsuul: Now try (mutable '(a . b)) (to use your example). 05:38:53 (mutable (quote (a . b)) 05:39:03 (mutable (quote (a . b))) 05:39:04 Oops, you have to address it to rudybot. 05:39:14 ah ok 05:39:18 rudybot: (mutable (quote (a . b))) 05:39:18 Axsuul: error: reference to undefined identifier: mutable 05:39:26 Hmmmm. 05:39:28 Try this: 05:39:43 "rudybot: (define mutable (GRAB))" (without the quotes) 05:39:57 rudybot: (define mutable (GRAB)) 05:39:58 Axsuul: Done. 05:40:04 Right, now try again. :-) 05:40:09 rudybot: (mutable (quote (a . b))) 05:40:10 Axsuul: ; Value: (cons (quote a) (quote b)) 05:40:20 hmm 05:41:06 I'll buff up the function a little in a minute. :-) 05:42:43 Hmm yea what does mutable do? 05:42:56 I know it makes it so the list can be changed right? 05:43:21 Well, it just returns a mutable representation of what you're passing in. 05:43:35 Like, '(a . b) is not mutable, but (cons 'a 'b) is. 05:44:49 So, here's my buffed up version: (type "rudybot: (define mutable2 (GRAB))" to get it) 05:44:55 rudybot: give Axsuul mutable 05:44:55 Axsuul: cky has given you a value, say "rudybot: eval (GRAB)" to get it (case sensitive) 05:45:07 It handles lists and vectors too. 05:45:10 rudybot: eval (GRAB) 05:45:11 Axsuul: ; Value: # 05:45:26 how do I see the source of these expressions? 05:45:28 :) 05:45:39 I don't know how to do it in PLT. 05:45:46 (or Racket.) 05:46:15 Anyway. Type "rudybot: (define mutable2 (GRAB))" (without quotes) and you can access the new version as mutable2. 05:46:29 rudybot: (define mutable2 (GRAB)) 05:46:29 Axsuul: Done. 05:46:42 Now try it with a list: (mutable2 '(1 2 3 4 5)) 05:46:51 rudybot: (mutable2 '(1 2 3 4 5)) 05:46:52 Axsuul: ; Value: (list 1 2 3 4 5) 05:46:59 (and compare it with the result of (mutable '(1 2 3 4 5)).) 05:47:10 rudybot: (mutable '(1 2 3 4 5)) 05:47:10 Axsuul: ; Value: (cons 1 (list 2 3 4 5)) 05:47:23 Hahaha, nice. I stuffed the last one up, I see. 05:47:35 (It's supposed to keep expanding the rest of the list into cons expressions too.) 05:47:41 cky: how are you buildilng these expressions? 05:47:55 Heh 05:48:11 franki^: My new "mutable" overwrote the binding used by the old "mutable", hence what you see. 05:48:19 Serious fail on my part, really. 05:48:57 Axsuul: How do you build any expression? :-) 05:49:33 cky: I mean, is there any way I can see how you are "define"ing those expressions? 05:49:36 Yeah, that sounds silly, but the function does appear a little magical from my perspective. I'm not really sure how to go about this either 05:49:56 franki^: I'll send you the code (since it's not your homework :-P). 05:49:59 Thanks Axsuul, for sharing your educational experience with me :) 05:50:22 Axsuul: I don't know. With Guile, you can use (procedure-source mutable), for example, but I don't believe Racket has that. 05:51:06 cky: Give me a minute to try and figure it out. (Although I really need to have a shower now..) 05:52:00 Sure thing. 05:52:17 cky: So I assume mutable/2 is recursive? 05:52:27 Axsuul: Yes, they both are. 05:53:38 The thing is, it's a really easy problem. If it feels hard, that means you're overthinking it. :-) 05:54:09 rudybot: (mutable2 (a . b)) 05:54:09 Axsuul: error: eval:1:10: application: bad syntax in: (a . b) 05:54:26 rudybot: (mutable2 (quote (a . b))) 05:54:26 Axsuul: ; Value: (cons (quote a) (quote b)) 05:55:36 rudybot: (mutable (quote (1 2 3 4 5))) 05:55:36 Axsuul: ; Value: (cons 1 (list 2 3 4 5)) 05:56:13 Axsuul: I'm going to resend you a mutable1 that deconstructs a list properly. 05:57:47 cky: Cool thanks 05:58:04 Got it! 05:58:19 That was much simpler than I was expecting :) 05:59:13 franki^: what are you working on? 05:59:36 Axsuul: MIT-Scheme? If that's what you're asking 05:59:38 franki^: Exactly. :-) 05:59:41 Or, your homework 05:59:46 If that's what you're asking :) 06:01:04 franki^: Ah 06:01:17 cky: Out of interest, why did you call the function "mutable"? 06:02:18 franki^: Because it creates mutable representations of the given expressions. 06:02:30 franki^: For example, '(1 2 3 4 5) is not mutable, but (list 1 2 3 4 5) is. 06:02:50 rudybot: give Axsuul mutable1 06:02:51 Axsuul: cky has given you a value, say "rudybot: eval (GRAB)" to get it (case sensitive) 06:03:04 rudybot: eval (GRAB) 06:03:04 Axsuul: ; Value: # 06:03:05 Axsuul: Say: "rudybot: (define mutable1 (GRAB))" 06:03:13 (define mutable1 (GRAB)) 06:03:16 rudybot: (define mutable1 (GRAB)) 06:03:17 Axsuul: Done. 06:03:30 Cool. Now try (mutable1 '(1 2 3 4 5)) 06:03:35 (mutable1 (quote 1 2 3 4 5)) 06:03:40 rudybot: (mutable1 (quote 1 2 3 4 5)) 06:03:40 Axsuul: error: eval:1:10: quote: bad syntax (wrong number of parts) in: (quote 1 2 3 4 5) 06:03:49 phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has joined #scheme 06:03:52 Hahahaha. You missed a level of brackets. 06:04:07 rudybot: (mutable1 (quote (1 2 3 4 5))) 06:04:07 cky: ; Value: (cons 1 (cons 2 (cons 3 (cons 4 (cons 5 ()))))) 06:04:10 cky: Hm, you mean because, for example, (set-car! '(1 2 3) 4) doesn't actually change the list '(1 2 3)? 06:04:12 rudybot: (mutable1 (quote (1 2 3 4 5))) 06:04:12 Axsuul: ; Value: (cons 1 (cons 2 (cons 3 (cons 4 (cons 5 ()))))) 06:04:34 '(1 2 3) is always '(1 2 3)? 06:04:35 (eval (cons 1 (cons 2 (cons 3 (cons 4 (cons 5 ())))))) 06:04:35 franki^: Right, implementations are entitled to reject it. 06:04:43 rudybot: (eval (cons 1 (cons 2 (cons 3 (cons 4 (cons 5 ())))))) 06:04:43 Axsuul: error: eval:1:46: #%app: missing procedure expression; probably originally (), which is an illegal empty application in: (#%app) 06:04:44 Hm, I think I get it 06:04:56 rudybot: (set-car! '(1 2 3) 4) 06:04:56 cky: error: reference to undefined identifier: set-car! 06:04:58 I'll think about it in the shower o/ 06:05:02 franki^: Have fun! 06:05:11 *cky* forgot the import that enables set-car!. Oh well. 06:05:38 Axsuul: Oops, I forgot to quote an empty list. 06:05:41 Axsuul: I'll fix that. 06:05:46 cky: i believe its print-graph? 06:06:02 or mutable-pairs 06:06:16 rudybot: (import (rnrs eval (6))) 06:06:16 Axsuul: error: eval:1:0: import: misuse of unit keyword in: (import (rnrs eval (6))) 06:06:58 rudybot: give Axsuul mutable1 06:06:58 Axsuul: cky has given you a value, say "rudybot: eval (GRAB)" to get it (case sensitive) 06:07:34 rudybot: eval (GRAB) 06:07:34 Axsuul: ; Value: # 06:07:45 rudybot: (mutable1 (quote (1 2 3 4 5))) 06:07:45 Axsuul: ; Value: (cons 1 (cons 2 (cons 3 (cons 4 (cons 5 ()))))) 06:07:52 Um. 06:07:57 You need to assign it to mutable1 first. 06:08:03 ah yes 06:08:09 rudybot: (define mutable1 (GRAB)) 06:08:09 Axsuul: Done. 06:08:14 rudybot: (mutable1 (quote (1 2 3 4 5))) 06:08:14 Axsuul: ; Value: (cons 1 (cons 2 (cons 3 (cons 4 (cons 5 (quote ())))))) 06:08:19 Much better. :-) 06:08:51 rudybot: (mutable1 (quote (a b))) 06:08:51 Axsuul: ; Value: (cons (quote a) (cons (quote b) (quote ()))) 06:09:12 rudybot: (mutable1 (quote a)) 06:09:13 Axsuul: ; Value: (quote a) 06:09:24 rudybot: (mutable1 (quote (quote a))) 06:09:24 Axsuul: ; Value: (cons (quote quote) (cons (quote a) (quote ()))) 06:10:03 rudybot: (mutable1 (quote (a #f #\c (27 "x")))) 06:10:03 Axsuul: ; Value: (cons (quote a) (cons #f (cons #\c (cons (cons 27 (cons "x" (quote ()))) (quote ()))))) 06:10:07 rudybot: (mutable2 (quote (quote a))) 06:10:07 cky: ; Value: (list (quote quote) (quote a)) 06:10:42 cky: nice demonstration, thanks 06:10:42 mutable2 is like mutable1 but doesn't deconstruct lists. 06:11:01 Cool, glad you like. 06:11:03 cky: unfortunately, i dont know how to see how you did it? :p 06:12:01 Well, it would be unfair to your classmates if I revealed the answer. :-P 06:12:09 So you need to write your own version, but you can compare your answers with mine. 06:12:14 Trust me, it's really simple. 06:13:31 cky: Ah alright 06:17:19 *cky* sends compliments to offby1 for the gifting system. :-P 06:17:57 cky: so I suppose i have to convert the expression to some sort of list and then recurse through it? 06:18:58 Axsuul: I suppose you can look at it that way, yes. 06:20:23 -!- pchrist [~spirit@gentoo/developer/pchrist] has quit [Read error: Connection reset by peer] 06:20:26 rudybot: (mutable2 #(1 2 3 #(4 5))) 06:20:27 cky: ; Value: (vector 1 2 3 (vector 4 5)) 06:22:07 Axsuul: Hint: my mutable1 is 8 lines. mutable2 is 9 lines. 06:22:18 Axsuul: Most of those lines are "cond" clauses. 06:22:47 (mutable2 simply has one more cond clause than mutable1.) 06:22:59 pchrist [~spirit@gentoo/developer/pchrist] has joined #scheme 06:23:02 cky: did you make use of set-car! and set-cdr! 06:23:09 Of course not. 06:23:33 Hmm alright 06:27:57 rudybot: (mutable1 ''a) 06:27:57 Axsuul: ; Value: (cons (quote quote) (cons (quote a) (quote ()))) 06:28:15 rudybot: (mutable1 0) 06:28:15 Axsuul: ; Value: 0 06:29:52 cky: Hm, am I right in thinking that it's better to imagine (list 1 2 3) doesn't create the list (1 2 3) but that it "gives" you the list (1 2 3) from the Lispy universe of (immutabel) lists? 06:30:21 s/immutabel/immutable/ 06:31:42 franki^: Well, no, (list 1 2 3) is mutable. 06:31:48 franki^: But '(1 2 3) is not. 06:33:01 Right, but when you evaluate (list 1 2 3) what happens? If that makes sense... 06:33:33 I mean, in my current imagination "list" is a function that creates a list 06:33:47 And returns it, of course 06:35:34 cky: is there any way to tell if something is a pair or if something is a list? 06:35:58 -!- phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has quit [Ping timeout: 245 seconds] 06:36:06 But, from what you were saying earlier, I was thinking that it might not be a good idea to think of new lists being created in this way. If lists are immutable then there's no reason to create them 06:36:30 As in, if I evaluate (list 1 2 3) twice, it isn't creating two lists, it's giving me the same list twice. 06:36:38 Axsuul: Yes. 06:36:41 But, maybe I'm just talking rubbish here :) 06:36:49 rudybot: (pair? '(1 . 2)) 06:36:49 cky: ; Value: #t 06:36:54 rudybot: (pair? '()) 06:36:55 cky: ; Value: #f 06:37:04 rudybot: (list? '(1 2 3 4 5)) 06:37:04 cky: ; Value: #t 06:37:07 rudybot: (list? '()) 06:37:07 cky: ; Value: #t 06:37:23 cky: interesting, thanks 06:37:32 franki^: In reality, calling (list 1 2 3) twice will give you separate lists. 06:38:41 rudybot: (mutable1 '()) 06:38:41 Axsuul: ; Value: (quote ()) 06:39:14 cky: Okay, but how can you tell? 06:39:50 cky: If they're immutable, it's not like you can set-car! one and see if the other changes too. 06:40:19 rudybot: (mutable1 '(1 . 2)) 06:40:20 Axsuul: ; Value: (cons 1 2) 06:40:34 rudybot: (mutable1 (1 . 2)) 06:40:34 Axsuul: error: eval:1:10: application: bad syntax in: (1 . 2) 06:40:44 rudybot: (mutable1 '(a . b)) 06:40:44 Axsuul: ; Value: (cons (quote a) (quote b)) 06:40:53 franki^: You can use eq? to tell. 06:41:01 rudybot: (mutable1 (cons 1 2)) 06:41:01 rudybot: (eq? (list 1 2 3) (list 1 2 3)) 06:41:01 Axsuul: ; Value: (cons 1 2) 06:41:02 cky: ; Value: #f 06:41:19 Erm, i should directly msg rudybot 06:41:27 cky: I see 06:41:27 Axsuul: Probably. :-P 06:42:19 cky: how do you tell the difference if its a pointer or integer? 06:42:31 Axsuul: What's a pointer? 06:42:38 for example, your expression can differentiate between '(1 . 2) and '(a . b) 06:42:52 Well, a and b are symbols. 06:46:00 Yeah, the first time I wrote my function it didn't differentiate between symbols and, uhh, non-symbols (numbers, #t, #f) 06:46:33 But whilst watching the channel I realised what was going on :) 06:47:16 -!- Modius [~Modius@cpe-70-123-158-125.austin.res.rr.com] has quit [Quit: I'm big in Japan] 06:47:20 franki^: Feel free to PM me your implementation, if you have one. I'll send you mine. 06:48:49 dnm_ [~dnm@c-68-34-57-169.hsd1.va.comcast.net] has joined #scheme 06:50:27 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 06:55:44 -!- Hal9k [~Lernaean@unaffiliated/kusanagi] has quit [] 07:02:29 cky: quasiquote(`) and unquote(,) should be used in implementations of mutable1 function, right ? 07:03:11 cataska: Yes, I use ` and , liberally. 07:04:18 cataska: If that question isn't homework for you, I'll be happy to share my answer with you. 07:05:18 cky: please :) 07:07:46 cky: like magic, when you know it, it becomes simple 07:08:10 thanks 07:09:18 ah, quasiquote 07:10:08 cataska: :-) 07:12:17 Ah I think I got the pair working 07:13:26 Axsuul: Yay! 07:18:24 cky: Oh yes, I also want to mention that I also need to do expressions like this: (#0=(1 #1=(3 #0#)) #1#) 07:19:15 Hal9k [~Lernaean@unaffiliated/kusanagi] has joined #scheme 07:24:44 Axsuul: Hahahahaha. Nice. 07:24:56 Axsuul: Are you allowed to use SRFI 38? 07:25:55 rudybot: (require srfi/38) 07:25:55 cky: Done. 07:26:17 cky: not sure what that is 07:26:55 rudybot: (define a (#0=(1 #1=(3 #0#)) #1#)) 07:26:55 cky: error: eval:1:11: read: #..= expressions not allowed in read-syntax mode 07:27:18 Axsuul: basically, a SRFI is an official extention of Scheme. 07:28:00 rudybot: (define a (read-with-shared-structure (open-input-string "(#0=(1 #1=(3 #0#)) #1#)"))) 07:28:01 cky: Done. 07:28:05 rudybot: a 07:28:06 cky: ; Value: (#0=(1 #1=(3 #0#)) #1#) 07:28:10 Rather "official" "extension" of "Scheme". 07:28:29 cky: as long as it is supported by Racket 07:28:35 R6RS 07:28:54 Axsuul: Well, you can see how I loaded SRFI 38 in Racket. :-P 07:29:01 *Axioplase_* hesitated to put quotes around "official", but not the others and miswrote "extension" 07:30:10 Axioplase_: "Official" presumably refers to the fact that it does not have the Scheme Language Steering Committee's holy penguin pee on it. 07:30:21 Axioplase_: "Scheme" is obvious (and related to "official"); "extension" is because not all of them are extensions. 07:30:48 Basically.. #0=(0 . #0#) --> (let ((e (cons 0 #f))) (set-cdr! e e) e) 07:31:44 eli: not all are extensions? As in "it's just code you could've written yourself, not requiring modifications of the interpreter/compiler"? 07:35:39 Axioplase_: More to the point, what's an "extension", and what's a library? 07:35:51 rudybot: (map + '(1 2) '(1 2 3)) 07:35:54 eli: your sandbox is ready 07:35:54 eli: error: map: all lists must have same size; arguments were: # (1 2) (1 2 3) 07:36:01 rudybot: (require srfi/1) 07:36:01 eli: Done. 07:36:03 rudybot: (map + '(1 2) '(1 2 3)) 07:36:03 eli: ; Value: (2 4) 07:36:20 Axioplase_: Was that an extension, or a modification? 07:37:05 eli: I did not use the flame^Wword library. I call an extention something that lets you do some processing without having you writing the processor. 07:38:10 So, if you give me the source code of any function, that's an extention. If you give me a patch to have gambit understand reversed polish notation, that'll be an extention too. 07:40:08 IOW, you make "extension" general enough to not really say much. 07:42:38 eli: yes, that's why I wrote it. And I do believe that SRFI's belong to this definition, don't they? 07:43:08 And what difference does it make for someone who just want things done? 07:43:37 Well, yeah... You could just as well used "code". 07:45:41 -!- REPLeffect [~REPLeffec@69.54.115.254] has quit [Read error: Connection reset by peer] 07:47:51 mmc1 [~michal@cs27120227.pp.htv.fi] has joined #scheme 07:47:59 -!- mmc [~michal@cs27120227.pp.htv.fi] has quit [Read error: Connection reset by peer] 07:56:09 -!- Adamant [~Adamant@unaffiliated/adamant] has quit [Quit: Adamant] 08:01:45 REPLeffect [~REPLeffec@69.54.115.254] has joined #scheme 08:06:20 -!- jonrafkind [~jon@jonr5.dsl.xmission.com] has quit [Ping timeout: 245 seconds] 08:07:41 homie` [~user@xdsl-195-14-197-168.netcologne.de] has joined #scheme 08:09:11 wbooze` [~user@xdsl-195-14-197-168.netcologne.de] has joined #scheme 08:09:44 -!- wbooze [~user@xdsl-87-79-233-152.netcologne.de] has quit [Ping timeout: 240 seconds] 08:10:35 -!- homie [~user@xdsl-87-79-233-152.netcologne.de] has quit [Ping timeout: 260 seconds] 08:11:07 _danb_ [~user@124-149-32-186.dyn.iinet.net.au] has joined #scheme 08:18:56 Adamant [~Adamant@unaffiliated/adamant] has joined #scheme 08:20:26 aurelien [~Libre@fsf/member/aurelien] has joined #scheme 08:37:33 -!- aurelien [~Libre@fsf/member/aurelien] has quit [Quit: ()] 08:46:15 -!- hiyuh [~hiyuh@KD124214245222.ppp-bb.dion.ne.jp] has quit [Quit: |_ e /\ \/ i |/| G] 08:47:31 rdd [~rdd@c83-250-48-164.bredband.comhem.se] has joined #scheme 08:47:54 cky: still there? 08:50:25 fradgers- [~fradgers-@5e064cc1.bb.sky.com] has joined #scheme 09:03:27 Hmm how would I return something like... (quote a) instead of 'a 09:04:07 force the verbose 09:04:15 pavelludiq [~quassel@91.139.196.22] has joined #scheme 09:04:17 gravicappa [~gravicapp@ppp85-141-167-181.pppoe.mtu-net.ru] has joined #scheme 09:06:20 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Ping timeout: 245 seconds] 09:08:35 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 09:23:26 Mohamdu [~Mohamdu@CPE00222d6b3798-CM00222d6b3795.cpe.net.cable.rogers.com] has joined #scheme 09:24:28 Axsuul: that would be implementation dependant 09:24:46 But as a value, there's no difference, so I guess you want to *print* it verbosely 09:30:21 -!- Euthydemus [~euthydemu@vaxjo3.23.cust.blixtvik.net] has quit [Read error: No route to host] 09:30:40 Euthydemus [~euthydemu@vaxjo3.23.cust.blixtvik.net] has joined #scheme 09:42:56 Axioplase pasted "Verbose print-ish" at http://paste.lisp.org/display/116538 09:43:04 Axsuul: Something like that? 09:45:04 alaricsp [~alaric@94-194-200-54.zone8.bethere.co.uk] has joined #scheme 09:50:10 alaricsp_ [~alaric@geniedb.hotdesktop.biz] has joined #scheme 09:50:17 -!- alaricsp [~alaric@94-194-200-54.zone8.bethere.co.uk] has quit [Ping timeout: 250 seconds] 09:58:05 -!- _danb_ [~user@124-149-32-186.dyn.iinet.net.au] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 10:02:02 nik0 [~niko@freenode/staff/ubuntu.member.niko] has joined #scheme 10:04:40 -!- alaricsp_ is now known as alaricsp 10:07:58 -!- abstractj [~shadow_wa@187.56.174.29] has quit [Remote host closed the connection] 10:09:01 -!- nik0 is now known as niko 10:18:11 -!- Mohamdu [~Mohamdu@CPE00222d6b3798-CM00222d6b3795.cpe.net.cable.rogers.com] has quit [Quit: Leaving] 10:20:32 Axioplase_: wow, that big of an expression just to do that? 10:20:36 thanks bt 10:20:37 btw* 10:21:52 -!- niko [~niko@freenode/staff/ubuntu.member.niko] has quit [Remote host closed the connection] 10:33:57 hi there. is there a way to access the last element in a list. i know first and rest, but is there something like `last'? 10:41:08 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 265 seconds] 10:41:24 -!- pchrist [~spirit@gentoo/developer/pchrist] has quit [Quit: leaving] 10:41:59 pchrist [~spirit@gentoo/developer/pchrist] has joined #scheme 10:43:38 Zahl_: cdr 10:43:45 oh oops 10:43:47 misread 10:43:50 nm 10:44:19 -!- ineiros [~itniemin@james.ics.hut.fi] has quit [Ping timeout: 240 seconds] 10:44:29 Zahl_: did you try last/ 10:45:14 rudybot: (last '(1 2 3 4 5)) 10:45:14 Axsuul: ; Value: 5 10:46:09 ineiros [~itniemin@james.ics.hut.fi] has joined #scheme 10:47:30 no i didn't shame on me. ty 11:01:53 -!- cataska [~cataska@210.64.6.233] has quit [Quit: leaving] 11:18:16 -!- pavelludiq [~quassel@91.139.196.22] has quit [Remote host closed the connection] 11:22:29 phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has joined #scheme 11:27:13 -!- phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has quit [Ping timeout: 245 seconds] 11:30:08 -!- gravicappa [~gravicapp@ppp85-141-167-181.pppoe.mtu-net.ru] has quit [Ping timeout: 245 seconds] 11:36:05 abstractj [~shadow_wa@189.67.211.73] has joined #scheme 11:39:38 schmir [~schmir@mail.brainbot.com] has joined #scheme 11:46:48 -!- abstractj [~shadow_wa@189.67.211.73] has quit [Ping timeout: 245 seconds] 11:48:18 abstractj [~shadow_wa@189.67.211.73] has joined #scheme 11:50:58 hey 11:53:04 i wrote two functions that do the same thing, but one has linear time complexity O(n) and the other O(logn) 11:53:41 when i ran them with these inputs: 1000, 2000, 5000, 10 000, 100 000 and used (time) to measure the time they run, i don't see linear growth in time 11:55:01 Caleb pasted "Execution time" at http://paste.lisp.org/display/116541 11:55:22 ^ here are the stats 11:55:31 does anyone know why that might be? 11:56:26 from 1000 -> 2000 and 2000 -> 5000 it does seem to grow like the input, but after that it doesn't 11:57:14 -!- pjb [~t@81.202.16.46.dyn.user.ono.com] has quit [Remote host closed the connection] 11:59:38 -!- vu3rdd [~vu3rdd@nat/cisco/x-ulwokobiaqwolvab] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 11:59:49 MrFahrenheit [~RageOfTho@users-55-218.vinet.ba] has joined #scheme 12:01:48 dfkjjkfd [~paulh@236-9-ftth.onsnetstudenten.nl] has joined #scheme 12:02:30 pjb [~t@81.202.16.46.dyn.user.ono.com] has joined #scheme 12:02:47 pavelludiq [~quassel@91.139.196.22] has joined #scheme 12:05:12 -!- homie` [~user@xdsl-195-14-197-168.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 12:05:20 -!- wbooze` [~user@xdsl-195-14-197-168.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 12:09:24 homie [~user@xdsl-195-14-197-168.netcologne.de] has joined #scheme 12:12:07 wbooze [~user@xdsl-195-14-197-168.netcologne.de] has joined #scheme 12:14:46 kuribas [~user@d54C2AFD1.access.telenet.be] has joined #scheme 12:20:45 -!- MrFahrenheit [~RageOfTho@users-55-218.vinet.ba] has quit [Read error: Connection reset by peer] 12:22:55 -!- REPLeffect [~REPLeffec@69.54.115.254] has quit [Ping timeout: 265 seconds] 12:23:16 Caleb: you can attempt to fit them to a linear model, but it's probably easier to just collect more samples. 12:24:55 what would explain such a jumpt from 5000 to 10 000? 12:25:45 Who knows. Certainly not us, because we haven't read the code and done the benchmark. 12:25:50 the input size was doubled, but the runtime grew >x10 12:26:10 Try more timing samples, and profiling the code. 12:26:33 for different inputs? 12:27:11 You don't have enough data to form any nontrivial conclusions. 12:27:25 Does your implementation support profiling? 12:27:57 i'm using DrScheme v209 12:27:59 -!- leppie [~lolcow@196-215-20-67.dynamic.isadsl.co.za] has quit [Read error: Connection reset by peer] 12:28:08 leppie [~lolcow@196-215-20-67.dynamic.isadsl.co.za] has joined #scheme 12:28:33 Well, I suppose that paste already contains some profiling output. 12:28:38 REPLeffect [~REPLeffec@69.54.115.254] has joined #scheme 12:29:05 it was a homework assignment: http://www.cs.tau.ac.il/~scheme/mavo-fall-2010/Homework/homework4.doc 12:29:08 first question 12:29:16 they provided a table with the inputs 12:30:04 i'll paste the code too 12:30:25 Mike pasted "code_1" at http://paste.lisp.org/display/116542 12:30:30 ^ 12:30:51 Microsoft Word? Lovely. 12:31:01 :)) 12:31:22 -!- abstractj [~shadow_wa@189.67.211.73] has quit [Remote host closed the connection] 12:33:53 It seems strange that your programs spend so much time with the trash man, as those procedures are tail recursive and don't cons a lot. 12:34:05 Anyway, the problem seems to be that you misunderstand what "linear" means. 12:34:53 i thought it means "grows proportionally with input size" 12:35:10 What is it that grows proportionally with input size? 12:35:18 the run time 12:35:37 Does each iteration of your procedure use the same run time on your computer? 12:35:52 What happens to the sizes of the inputs to your procedures after each tail call? 12:36:59 in foo_linear i pretty much perform the same amount of operations until "n" reaches 0 12:37:27 s/n/count 12:38:44 Perhaps it should be the foo-iter that you should be concerned about. 12:38:46 tupi [~david@139.82.89.24] has joined #scheme 12:39:04 well, yeah, it does all the work 12:39:17 count decreases, but what happens to the sizes of the other parameters? 12:39:34 they grow 12:39:44 And how quickly do they grow? 12:40:26 what do you mean? 12:40:48 -!- TheRealPygo [~pygospa@217.191.212.154] has quit [Ping timeout: 265 seconds] 12:41:07 b = a and a = 2a + b 12:41:27 Do a and b grow linearly at each iteration? 12:41:28 -!- leppie [~lolcow@196-215-20-67.dynamic.isadsl.co.za] has quit [] 12:42:14 yeah, i think so 12:42:19 pygospa [~pygospa@217.191.199.41] has joined #scheme 12:43:11 No, they do not. 12:43:14 -!- Leonidas [~Leonidas@unaffiliated/leonidas] has quit [Ping timeout: 264 seconds] 12:43:18 Leonidas [~Leonidas@unaffiliated/leonidas] has joined #scheme 12:43:25 What values do a and b take, anyway? 12:44:22 the sequence looks like this: 0, 1, 2, 5, 12, 29, etc.. 12:44:45 b is initialized to be "0" and a to be "1" 12:45:13 on every iteration i calculate a "new" a, and set b to be the "old" a 12:45:37 so, b=0,a=1 b=1,a=2 b=2,a=5 etc... 12:45:51 Er, do you know what numbers are in the sequence generated by fib? 12:45:56 Yours are not those numbers. 12:46:10 that's not a fibonacci sequence 12:46:36 the sequence we were given is defined by 2foo(n-1) + foo(n-2) 12:46:37 Oops, you're right 12:46:42 and not foo(n-1) + foo(n-2) 12:47:56 leppie [~lolcow@196-215-20-67.dynamic.isadsl.co.za] has joined #scheme 12:48:01 Standard teacher trick to avoid canned answers about fibonacchi. :-) 12:48:19 :D 12:48:28 So, how fast do those numbers grow at each iteration? Like, print them and describe it. 12:48:43 oh 12:48:56 a seems to double 12:49:20 It clearly more than doubles -- as you can see from the code. 12:49:26 well, yeah 12:50:31 So a and b grow at a constant rate, or exponentially. How much time does it take to compute (+ (* 2 a) b) when they are large? 12:50:35 -!- pavelludiq [~quassel@91.139.196.22] has quit [Read error: Connection reset by peer] 12:52:03 not much, i suppose 12:52:31 Oh, you think? 12:52:51 :P 12:52:57 Have you added numbers by hand before? 12:53:02 i thought bought operations can be considered (1) 12:53:06 both* 12:53:44 O(1) is unitless. You can't point to O(1) and say it measures time. But O(1) multiplied by a unit of time, measures time. 12:54:40 but how am i supposed to take that into account? i don't know how much time addition and multiplication are going to take 12:54:46 it depends on the computer 12:55:16 The time of iterating a procedure also depends on the computer. What do you think the O() is for? 12:55:35 i treated the functions as T(n) = T(n-1) + (1) 12:55:39 and that came out as (n) 12:55:51 function* 12:56:01 (n) of what? 12:56:43 O(n) = O(100000000n) 12:57:01 O(M NOM NOM) 12:57:02 Jafet, of what? i thought constants didn't "really" matter 12:57:06 :P 12:57:29 Caleb--: unfortunately they do in practice :) 12:57:33 -!- kuribas [~user@d54C2AFD1.access.telenet.be] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 12:57:46 yeah :) 12:57:54 they describe an algorhytm, not a computation 12:58:11 but my function IS in linear time complexity, isn't it? 12:58:19 Caleb: does it mean anything if you say a procedure takes "42 time"? 12:58:24 I dont know, I did not see it 12:58:24 Or "5.2 memory"? 12:58:47 use "1000 brain cells" 12:58:51 how can i join all alements from my list to a single string? i tried http://nopaste.info/527f57509e.html but it doesnt work as i expected 12:58:57 Caleb: does it mean anything if you say a procedure takes "42 time"? 12:59:12 only of it's the answer to the ultimate question of life, the universe and everything. 12:59:45 leppie, http://paste.lisp.org/display/116542 12:59:53 gravicappa [~gravicapp@ppp85-141-167-181.pppoe.mtu-net.ru] has joined #scheme 12:59:55 Caleb--: 209?? 13:00:07 yes 13:00:15 Zahl_: You are returning 0 13:00:25 Caleb--: That's so ancient it's not even funny. 13:01:00 eli, that's what they're using.... 13:01:02 leppie: but what should i else return to get the actual string 13:01:14 From a course that gives homework in Word files... come on, it's worth a chuckle. 13:01:17 the result, lst I think 13:01:27 no oops 13:01:34 Caleb--: Did "they" gave a reason? 13:01:38 it gives me the error: string-append: expects type as 2nd argument, given: 0; other arguments were: "dog" 13:01:41 eli, no 13:01:57 Caleb--: Will it help to come and shout? 13:01:59 Zahl_: just an empty string should do 13:02:23 wow, how could that be? 13:02:26 eli, i guess the reason would be: "we know 209 works, and we don't want to bother upgrading to a new version because we don't want to deal with the problems" 13:02:33 Zahl_: "" 13:02:35 i mean if i return an empty one how could it be filled 13:02:51 yes it works 13:02:57 Zahl_: It is the terminating condition 13:03:11 all recusion works like that, else your program never stops 13:03:33 Caleb--: It looks like you're following SICP (which, IIRC, has been done at TAU since the early 90s), and there's is now specific SICP support. 13:03:42 (One that will definitely not work with 209.) 13:04:08 okay, but why if i return an empty one my result is fine? i mean if i programm in c when i return("") i dont get another result of my function but "" 13:04:10 Zahl_: your scheme might have astring-join procedure too, to make life easier. just join with an empty string again 13:04:41 is it a thing of recursion? 13:04:56 elf, "specific SICP support"? does SICP use a different Scheme variation or something? 13:05:05 Zahl_: remember at the terminating condition, the stack is at it's highest (in the case), and starts rolling back doing all the string-append 13:05:50 Zahl_: on 2nd thought (define (append-strings lst) (apply string-append lst)) would work 13:07:03 Caleb--: (It's "eli") see http://www.neilvandyke.org/sicp-plt/ -- it has a bunch of goodies included, and some particularities that SICP assumes. 13:07:27 mm. but i still dont get why "" should be the terminator. when i sum up integers would "" also be my terminator. or in atoher words is "" always a terminator in recursion context? 13:07:57 eli, auto-completion laziness :) 13:07:59 Zahl_: write out the steps for that computation, it should be easy to see 13:09:02 ah okay ill play a little with the code 13:09:07 Jafet, so... is foo_linear that i wrote does not  (n) ? 13:09:25 Jafet, so... does foo_linear that i wrote not  (n) ? 13:09:34 grammar :( 13:09:35 Caleb: again, (n) of what? 13:09:46 of nothing 13:09:56 Well, that's a meaningless question. 13:10:03 *Jafet* flips a coin 13:10:05 i don't know any other way 13:10:35 Perhaps you should study a book on computational theory. 13:10:56 I'm fairly sure SICP discusses O-notation a bit, but perhaps not enough. 13:11:03 Jafet: I feel for you, I tried to explain this once, and people got very upset :) 13:11:15 we ran functions, analyzed their complexity with recurrence relations and then wrote whether they were (n) or (logn) or whatever was the dominant "grower" 13:11:31 It's a common thinking error, and I used to suffer from it as well. 13:11:48 the course on Complexity is only next year 13:11:50 when in doubt use a hashtable :) 13:12:34 O notation is the upper bound 13:17:11 -!- DrDuck [~duck@adsl-81-91-116.hsv.bellsouth.net] has quit [Ping timeout: 255 seconds] 13:18:18 Jafet: IIRC it was something like do EXP n in less than O(n) time or something absurd like that, acting on a single value 13:19:15 Caleb--: no really, when do we every see O(1) in practice? more like O(1.1) 13:19:17 :) 13:19:56 On the other hand, order of growth provides a useful indication of how we may expect the behavior of the process to change as we change the size of the problem. For a (n) (linear) process, doubling the size will roughly double the amount of resources used. For an exponential process, each increment in problem size will multiply the resource utilization by a constant factor. 13:19:59 from SICP 13:20:25 That's something I' 13:20:29 Ah, carefully worded to be just barely misleading enough. 13:20:29 I've never considered. 13:20:34 Then again I'm still early in my studies. 13:20:51 Jafet, that's how i understand it :S 13:22:34 each increment, that's worded very scary :) 13:22:41 that's why i thought that if my time complexity is theta of n, then doubling the input size (using a bigger number) will roughly double the run time 13:23:07 maybe i didn't word that sentence properly 13:23:16 Seminumerical Algorithms has a good explanation of integer arithmetic with computers, and Knuth isn't sloppy with the notation. Unfortunately, he isn't loose with the abstraction either. 13:23:22 should i say "time complexty is theta of n" or "order of growth is theta of n"? 13:23:40 i mean, order of growth can refer both to space and time 13:24:23 but there is no relation between them 13:24:51 maybe i have my terminology mixed up 13:25:46 I have never used big O notation with space constraints (does anyone really care about that anyway unless they get an OOM error?) 13:26:05 Because I pity you and your course and your ancient drscheme, I'll try one last time with an analogy. 13:26:45 HG` [~HG@xdsl-92-252-105-72.dip.osnanet.de] has joined #scheme 13:27:11 A recipe uses a certain amount of flour. For a given serving size, is it meaningful to say that it uses "5 flour"? 13:27:12 Jafet: is it so ancient that you would consider using IronScheme instead? 13:27:15 :) 13:27:29 no 13:27:46 screw the analogies, maybe i'll understand better if you bring out the dolls 13:27:47 :p 13:28:01 Okay, I tried. 13:28:13 ok, tell me if i'm wrong 13:28:40 if we use R(n) to measure resources. Time, for instance 13:29:08 we find that R(n) = 5n + 24 13:29:26 can i say that R(n) has an order of growth of theta n? 13:30:24 R(n) isn't tied to any unit of time, so saying that R(n) measures time is meaningless. 13:31:01 it's just theoretical 13:31:14 it's obvious that the results would be different on different machines 13:31:56 Too bad, you have made exactly no progress on this thinking error. I can't say anything more, except that perhaps you should get into Knuth's presentation of complexity as quickly as possible. 13:31:58 but the pattern should be the same, shouldn't it? if we would double the input size, the resource utilization is roughly doubled 13:32:27 Jafet, R(n) does not measure time, it measures how time will change when the input is changed 13:32:32 Caleb--: if n is massive, and it gets doubled, the time will double for that given R(n) 13:32:45 leppie, so how am i wrong? 13:32:55 you've just told me what i was saying all along 13:33:02 so, in other words, you can pretty much drop all the constants 13:34:32 Jafet, btw, which of Knuth's book covers complexity? 13:34:36 but only for time, resource utilization is too vague 13:34:46 leppie, that's what i was saying 13:34:58 leppie, did you see the code i pasted? 13:35:36 Caleb--: Yes, but without knowing what it does, it is kinda pointless for me to look at it :) 13:35:58 leppie, http://www.cs.tau.ac.il/~scheme/mavo-fall-2010/Homework/homework4.doc 13:36:01 first question 13:36:01 :) 13:36:55 Caleb--: all of knuth's book cover complexity 13:36:57 it's R(n) (where R(n) measures Time) has an order of growth of theta of n 13:37:02 its* 13:38:20 leppie, do you see the table on the first question? 13:38:36 i was supposed to measure the time it takes to run for various inputs 13:38:46 yeah 13:39:13 I don't think The TeX Book discusses computational complexity very much. 13:39:40 All three-and-a-half volumes of TAOCP do, of course. 13:39:44 leppie, but look at those execution times: http://paste.lisp.org/display/116541 13:40:11 Jafet: 4th will be on the shelves in january 13:40:20 i thought that, as the SICP book says, when the order of growth is linear, when the input is doubled, so is the resource utilization (time) 13:40:22 Caleb--: get yourself Concrete Math 13:40:38 ment, i'm only in my 1st semester 13:40:49 i'm not sure if my math is up to it 13:41:11 Caleb--: now those numbers are meaningless, turn off all optimizations 13:41:38 CPU cache is a beautiful thing too :) 13:41:40 leppie, where? 13:41:46 i dunno 13:41:51 lol 13:42:35 try with bigger numbers 13:43:17 the 1st 4 cases in the log one is useless 13:44:24 Caleb--: that book is written for freshman 13:44:32 orly? 13:45:05 leppie, running with 1 million 13:45:12 taking a helluva lot of time 13:46:45 they dont have to be much bigger, just as long as it takes a second or so, then start double the numbers and note the time taken 13:47:24 can i suppress output from (time)? 13:47:33 so it only shows me the time, without the output of the original function 13:47:56 (time (define f ...)) 13:48:16 nope i dont think so 13:48:55 but why is it showing too much? 13:49:06 it should just be a proc call 13:49:11 Caleb--: what was your problem again? 13:49:15 1000, 2000, 4000, 8000 -> 1, 2, 6, 20 13:49:24 "real time" 13:49:28 Caleb--: nope :| 13:49:53 god, this is giving me a headache 13:49:58 there might be a timer proc that returns that data 13:50:15 but generally time just prints to std out 13:50:26 ment, please use scrollback 13:51:30 Caleb--: I would not worry about complexity too much, it is something you gain with experience 13:51:52 yeah, but i have to explain these answers in the homework 13:52:22 Caleb--: nah. i think i will rather make myself some coffee. 13:52:29 ment :) 13:52:37 make me a cuppa 13:52:50 Knuth's dedication is also famous: 13:52:50 This series of books is affectionately dedicated 13:52:50 to the Type 650 computer once installed at 13:52:50 Case Institute of Technology, 13:52:50 in remembrance of many pleasant evenings. 13:53:01 knuth had sex with a computer? o_O 13:53:11 the general pattern is (for lookups for example): hashtable 0(1), tree/sortedlist O(log n), list O(n) for each nested loop, multiply 13:53:54 Caleb--: i just glanced over the homework, there's a nice algorithm for computing fib numbers in log time if that's what you're after 13:53:54 anyways, thats how they tended to test us 13:54:07 ment, i already wrote it 13:54:13 ment: I got stuck there :) 13:54:29 and it's not a fib series, look at the definition coser 13:54:31 closer* 13:54:46 -!- HG` [~HG@xdsl-92-252-105-72.dip.osnanet.de] has quit [Quit: Leaving.] 13:54:53 I guess I just have never erally needed to do that :) but the answer will be interesting 13:55:01 the algo would be the same with different matrix 13:55:25 ment, http://paste.lisp.org/display/116542 13:55:53 it's funny, we didn't cover linear transformations in Linear Algebra 1 yet, and they already popped up in this homework assignment, so i had to do some reading 13:56:27 i feel like a blind man in an orgy 13:56:37 Caleb--: that confused me too, I dont think we touch that in first year 13:56:57 *leppie* only did 1st year enginering 13:57:00 :| 13:58:10 i'm a certified college dropout 13:58:42 wtf 13:58:47 the 2nd homework question 13:58:54 I have a bachelors degree in economics focusing on marketing 13:58:56 i don't even understand wtf they want 13:58:58 :) 14:00:50 Caleb--: f0 seems to compute some log-ish function 14:01:44 Caleb--: so eq would be something like floor(lg(n)) and complexity would be O(log n) 14:01:56 Caleb--: then you plug that into second function etc. etc. 14:02:28 oh :) 14:02:45 logn didn't pop into my mind 14:05:33 but it's not floor() 14:05:39 (f0 0 3) returns 2 14:06:34 +- some constant 14:06:48 i didn't understand the "mathematical" equation 14:07:12 floor(logn) would be considered mathematical? :) 14:07:18 yeah 14:07:29 ok 14:07:30 there are symbols for that so you don't have to write floor 14:07:57 http://en.wikipedia.org/wiki/Floor_and_ceiling_functions 14:08:24 yeah, we used those in calculus :) 14:08:58 is there ceil() function in scheme>? 14:09:01 Axsuul: You can easily say something with "quote" by simply building a list with it. 14:09:09 rudybot: ''a 14:09:09 cky: ; Value: (quote a) 14:09:26 rudybot: (define foo 'bar) `',foo 14:09:27 cky: ; Value: (quote bar) 14:10:03 Axsuul: I hope that helps. 14:11:20 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 14:13:26 Axioplase_: Re your answer: I think doing "display" misses the point of the exercise. 14:13:48 Axioplase_: I think the point is to create data structures that can be eval'd (without having to be read back in). 14:14:27 Axsuul: My answer is simpler than Axioplase_'s, BTW. So don't despair. 14:15:18 Axsuul: (As I said, it's 8 or 9 lines depending on whether you want to special-case lists.) 14:21:06 mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #scheme 14:27:20 -!- Adamant [~Adamant@unaffiliated/adamant] has quit [Quit: Adamant] 14:28:37 Caleb--: You have a dirty mind. Knuth wrote that dedication in the 60s IIRC, before people automatically read "pleasant evening" in _quite_ that way. Hell, I still don't read that dedication quite that way; it was just an awesome machine to hack, is what I read from it. 14:28:49 :-P 14:29:04 i was joking! 14:29:07 Hehehehehehe. 14:29:11 but yes, i do have a dirty mind. 14:30:24 Re your earlier question: 14:30:31 rudybot: (ceiling 3.6) 14:30:31 cky: ; Value: 4.0 14:30:40 Caleb--: ^^--- 14:31:36 rudybot: (ceiling 61/60) 14:31:37 cky: ; Value: 2 14:31:38 danke 14:31:41 :-) 14:40:25 HG` [~HG@xdsl-92-252-105-72.dip.osnanet.de] has joined #scheme 14:46:39 vu3rdd [~vu3rdd@122.166.144.30] has joined #scheme 14:52:33 -!- tupi [~david@139.82.89.24] has quit [Remote host closed the connection] 14:56:16 hmm 14:56:28 femtoo [~femto@95-89-197-196-dynip.superkabel.de] has joined #scheme 14:59:06 if a function calls only another function that has a time complexity of (logn) with an input that will only make it recurse once, is the original function (logn) or (1) ? 14:59:29 -!- rmrfchik_ is now known as rmrfchik 14:59:39 that is, do i take the worst case, even though i will never reach it? 15:00:21 If the first function ensures that the second function is always called on arguments giving O(1), then it will be O(1). 15:00:35 Hi there. As I am working with DrRacket and LaTeX I was wondering if there was any good way to process sourcecode. I found lstlisting wich is quite cool, but a) it just supports Lisp and b) it doesn't provide colored syntax highlighting. 15:01:25 pygospa: Tried slatex? 15:01:30 Now there is a way to defin and add colors in lstlisting - which is why I was wondering if anybody already went through the troubble of creating a template? 15:01:40 http://wiki.call-cc.org/egg/slatex 15:01:47 Caleb--: when you call a function with specific arguments (or subclass of arguments), you get specific time, (or time complexity). 15:01:53 IIRC drscheme ships with a slatex script as well 15:02:16 Caleb--: if the second function was called with a constant, we'd be O(1), even if the time needed to compute that was very big. 15:02:53 pjb, this function i am calling does log_2{n} (log of n to the base of 2), with n being 2 15:03:01 it does it recursively though 15:03:11 so for n = 2, it only recurses once and then returns 15:03:35 tupi [~david@139.82.89.24] has joined #scheme 15:03:56 oh, i see your point 15:04:46 thanks 15:07:20 -!- schmir [~schmir@mail.brainbot.com] has quit [Remote host closed the connection] 15:09:21 pavelludiq [~quassel@91.139.196.22] has joined #scheme 15:11:55 pumpkin [~pumpkin@user-142hbak.cable.mindspring.com] has joined #scheme 15:40:50 -!- dnm_ [~dnm@c-68-34-57-169.hsd1.va.comcast.net] has quit [Ping timeout: 272 seconds] 15:42:08 firecrow8 [~fcrow@69.38.169.34] has joined #scheme 15:45:30 -!- gravicappa [~gravicapp@ppp85-141-167-181.pppoe.mtu-net.ru] has quit [Ping timeout: 245 seconds] 15:47:51 -!- samth_away is now known as samth 15:48:23 phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has joined #scheme 15:52:43 -!- phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has quit [Ping timeout: 240 seconds] 15:54:11 aurelien [~Libre@fsf/member/aurelien] has joined #scheme 15:54:13 langmartin [~user@exeuntcha2.tva.gov] has joined #scheme 16:02:25 -!- Kovensky [~kovensky@abraxo.bluebottle.net.au] has quit [Ping timeout: 240 seconds] 16:09:29 It is really funny to continue for me still. - I feel myself owe to 16:09:29 answer in the topic - for You still pay attention to it - the thing I 16:09:30 greatly appreciate. But myself - I think we are just trying to find 16:15:14 Kovensky [~kovensky@abraxo.bluebottle.net.au] has joined #scheme 16:23:25 -!- mmc1 [~michal@cs27120227.pp.htv.fi] has quit [Ping timeout: 240 seconds] 16:26:00 MrFahrenheit [~RageOfTho@users-55-106.vinet.ba] has joined #scheme 16:27:33 EbiDK [~ebi@3e6b7ac3.rev.stofanet.dk] has joined #scheme 16:35:06 phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has joined #scheme 16:35:54 -!- EbiDK [~ebi@3e6b7ac3.rev.stofanet.dk] has quit [Remote host closed the connection] 16:38:50 wingo [~wingo@81.38.184.100] has joined #scheme 16:40:34 EbiDK [~ebi@3e6b7ac3.rev.stofanet.dk] has joined #scheme 16:42:58 -!- aurelien [~Libre@fsf/member/aurelien] has quit [Quit: be free!!] 16:50:56 gravicappa [~gravicapp@ppp85-140-116-26.pppoe.mtu-net.ru] has joined #scheme 16:52:19 -!- phirefly [~phirefly@174-16-217-128.hlrn.qwest.net] has quit [Ping timeout: 240 seconds] 16:52:42 Oops, random pasting 16:52:46 Many apologies 16:52:54 I have no idea where that even came from... 16:54:16 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Quit: Leaving] 16:56:59 When that happens to me, I generally blame my cat. 16:57:07 "Bad kitty! Remember what we said about walking on the keyboard?" 17:00:17 :) 17:00:37 I should do that too, none of you know that I don't have a cat, or that I'm at work! 17:09:03 -!- REPLeffect [~REPLeffec@69.54.115.254] has quit [Ping timeout: 265 seconds] 17:10:07 -!- spacebat [~spacebat@ubermonkey.net] has quit [Ping timeout: 250 seconds] 17:10:08 -!- Kovensky [~kovensky@abraxo.bluebottle.net.au] has quit [Ping timeout: 255 seconds] 17:10:25 on the internet, nobody knows you're a kitten 17:11:54 spacebat [~spacebat@ubermonkey.net] has joined #scheme 17:15:42 *meow* 17:16:08 'lo foof 17:16:35 hey alaricsp 17:16:38 kuribas [~user@d54C2AFD1.access.telenet.be] has joined #scheme 17:16:53 sorry 'bout the delay with the ballot, I'll post the new results this weekend 17:16:56 What timezone are you in now? :-) 17:16:57 Hey, that's OK 17:16:58 rpg [~rpg@216.243.156.16.real-time.com] has joined #scheme 17:17:12 Sorry we all got confused and put the ballots in the wrong places 17:17:43 I'm in California. 17:18:02 I was a bit pissed off that this caused people to start arguing about the voting system, too! 17:18:03 alaricsp: That really isn't an issue, the problem is some of the options were changed. 17:18:07 I quite like california 17:18:12 What bit of it? 17:18:31 At least some were split from foo to foo/core and foo/module. 17:18:59 seangrove [~user@c-71-198-44-87.hsd1.ca.comcast.net] has joined #scheme 17:19:15 I didn't make it clear that _if_ you were voting on a /bar variant, you should still vote for the plain foo. 17:19:22 TBH, I think the module/not module thing is kind of orthogonal to "which API or do we punt it to WG2" decision... but hey 17:19:24 Interesting 17:19:35 That makes sense 17:19:46 -!- pumpkin [~pumpkin@user-142hbak.cable.mindspring.com] has quit [Quit: Computer has gone to sleep.] 17:19:55 But as it is, old votes had foo, and new votes didn't. I've hacked up some logic to assume a foo from foo/bar, but need to double check it. 17:20:01 I was worrying about the consequences of voting for a/1 or a/2 versus just a 17:21:23 Kovensky [~kovensky@abraxo.bluebottle.net.au] has joined #scheme 17:22:57 REPLeffect [~REPLeffec@69.54.115.254] has joined #scheme 17:23:22 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 17:25:46 alaricsp: which is why the people who cared were suppoed to put all three in order, and the people who don't are supposed to just put a 17:29:00 jonrafkind [~jon@crystalis.cs.utah.edu] has joined #scheme 17:31:46 -!- REPLeffect [~REPLeffec@69.54.115.254] has quit [Ping timeout: 265 seconds] 17:40:27 http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.6 17:40:35 i have a question regarding their "expmod" implementation 17:40:52 it's under the "The Fermat test" subheading 17:41:14 foof: Yeah, thanks for clarifying that 17:41:17 footnote 46 ( http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#footnote_Temp_78 ) says this: "For instance, in the case where e is even, we compute the remainder of be/2 modulo m, square this, and take the remainder modulo m. " 17:41:17 http://tinyurl.com/2ay3bjv 17:41:38 but the code first squares, and only then takes the remainder, what gives? 17:42:32 hmm... or maybe not 17:43:07 i guess that once exp = 0, it will just return 1, square it and take the remainder... then that remainder will get squared 17:43:14 and then it takes the remainder again 17:45:07 REPLeffect [~REPLeffec@69.54.115.254] has joined #scheme 17:49:39 -!- REPLeffect [~REPLeffec@69.54.115.254] has quit [Ping timeout: 265 seconds] 17:50:02 -!- Kovensky [~kovensky@abraxo.bluebottle.net.au] has quit [Ping timeout: 272 seconds] 17:50:27 Kovensky [~kovensky@abraxo.bluebottle.net.au] has joined #scheme 17:53:02 Caleb--: ...so, what was your point again? :-) 17:53:17 nothing 17:53:25 i figured it out by asking the question, very theraputic. 17:54:04 Nice. :-) 17:55:24 btw cky 17:55:33 if i want to write a recurrence relation for that expmod function 17:56:14 would it look like this: T(n) = T(n/2) + Q(1)? 17:56:22 (1) * 17:57:58 Darned if I know. 17:58:15 :D 18:01:28 that one seems to work out fine, thanks cky. 18:02:25 :-) 18:04:36 pumpkin [~pumpkin@131.247.67.79] has joined #scheme 18:07:03 -!- alaricsp [~alaric@geniedb.hotdesktop.biz] has quit [Quit: Leaving] 18:13:28 -!- wingo [~wingo@81.38.184.100] has quit [Ping timeout: 272 seconds] 18:16:20 moell [~user@150.181.35.213.dyn.estpak.ee] has joined #scheme 18:24:33 -!- MrFahrenheit [~RageOfTho@users-55-106.vinet.ba] has quit [Read error: No route to host] 18:24:42 MrFahrenheit [~RageOfTho@users-55-106.vinet.ba] has joined #scheme 18:25:24 choas [~lars@p5792C0FE.dip.t-dialin.net] has joined #scheme 18:26:04 wingo [~wingo@81.39.161.251] has joined #scheme 18:48:51 -!- tupi [~david@139.82.89.24] has quit [Read error: Connection reset by peer] 19:04:05 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Ping timeout: 250 seconds] 19:13:48 jcowan [c6b912cf@gateway/web/freenode/ip.198.185.18.207] has joined #scheme 19:14:21 and what ho and ho what. 19:14:47 rudybot: (/ (+ 1 sqrt(5)) 2) 19:14:51 Caleb--: your sandbox is ready 19:14:51 Caleb--: error: procedure application: expected procedure, given: 5 (no arguments) 19:14:59 oops 19:15:22 rudybot: (/ (+ 1 (sqrt 5)) 2) 19:15:22 Caleb--: ; Value: 1.618033988749895 19:15:26 :D 19:20:03 kar8nga [~kar8nga@78.104.81.161] has joined #scheme 19:27:47 abstractj [~shadow_wa@187.82.81.196] has joined #scheme 19:28:00 -!- wingo [~wingo@81.39.161.251] has quit [Ping timeout: 245 seconds] 19:32:13 -!- abstractj [~shadow_wa@187.82.81.196] has quit [Ping timeout: 245 seconds] 19:37:50 -!- vu3rdd [~vu3rdd@122.166.144.30] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 19:40:18 schmir [~schmir@p54A90832.dip0.t-ipconnect.de] has joined #scheme 19:40:24 -!- pumpkin [~pumpkin@131.247.67.79] has quit [Quit: Computer has gone to sleep.] 19:44:01 pchrist_ [~spirit@gentoo/developer/pchrist] has joined #scheme 19:44:30 -!- kar8nga [~kar8nga@78.104.81.161] has quit [Remote host closed the connection] 19:46:19 -!- pchrist [~spirit@gentoo/developer/pchrist] has quit [Ping timeout: 240 seconds] 19:46:49 Cowmoo [~Cowmoo@cambridge-vxty.basistech.com] has joined #scheme 19:58:50 pumpkin [~pumpkin@131.247.67.79] has joined #scheme 20:05:41 Ragnaroek [~chatzilla@pD951ED35.dip.t-dialin.net] has joined #scheme 20:08:11 -!- pumpkin [~pumpkin@131.247.67.79] has quit [Quit: Computer has gone to sleep.] 20:11:23 -!- schmir [~schmir@p54A90832.dip0.t-ipconnect.de] has quit [Ping timeout: 245 seconds] 20:16:04 pumpkin [~pumpkin@131.247.67.79] has joined #scheme 20:25:07 -!- HG` [~HG@xdsl-92-252-105-72.dip.osnanet.de] has quit [Quit: Leaving.] 20:49:05 hotblack23 [~jh@p57B59D19.dip.t-dialin.net] has joined #scheme 20:51:48 Alyssa P. Hacker? Come on.... 20:52:40 Caleb--: Hmmm? 20:52:59 Caleb--: That's like J. Random Hacker, or (in non-coder-land) Jane/John Doe, right? :-P 20:53:10 Exercise 1.25. Alyssa P. Hacker complains that we went to a lot of extra work in writing expmod. 20:53:24 Exactly as I thought, then. 20:57:19 wbooze` [~user@xdsl-87-79-140-119.netcologne.de] has joined #scheme 20:58:13 -!- wbooze` [~user@xdsl-87-79-140-119.netcologne.de] has quit [Read error: Connection reset by peer] 20:59:27 -!- homie [~user@xdsl-195-14-197-168.netcologne.de] has quit [Ping timeout: 240 seconds] 21:00:02 -!- wbooze [~user@xdsl-195-14-197-168.netcologne.de] has quit [Ping timeout: 264 seconds] 21:02:45 pothos_ [~pothos@111-240-215-136.dynamic.hinet.net] has joined #scheme 21:05:06 -!- pothos [~pothos@111-240-205-159.dynamic.hinet.net] has quit [Ping timeout: 272 seconds] 21:05:17 -!- pothos_ is now known as pothos 21:05:21 -!- samth [~samth@punge.ccs.neu.edu] has quit [Remote host closed the connection] 21:05:38 No, Alyssa is only distantly related to J. Random. J. Random may or may not be any good, whereas Alyssa invariably has the right idea, even if she doesn't quite have the details right yet. 21:06:38 -!- seangrove [~user@c-71-198-44-87.hsd1.ca.comcast.net] has quit [Ping timeout: 264 seconds] 21:07:34 samth [~samth@punge.ccs.neu.edu] has joined #scheme 21:08:37 cky, there's an extra pun there - A Lyssap (Lispy) Hacker 21:11:10 gabot [~eli@winooski.ccs.neu.edu] has joined #scheme 21:13:44 MichaelRaskin [~MichaelRa@195.91.224.225] has joined #scheme 21:14:12 djino [~djino__@91.218.156.245] has joined #scheme 21:14:33 -!- metasyntax` [~taylor@12.132.219.7] has quit [Quit: Be seeing you.] 21:15:29 zeroish [~zeroish@135.207.174.50] has joined #scheme 21:16:39 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Remote host closed the connection] 21:16:47 -!- Cowmoo [~Cowmoo@cambridge-vxty.basistech.com] has quit [Ping timeout: 276 seconds] 21:24:57 schmir [~schmir@p54A90832.dip0.t-ipconnect.de] has joined #scheme 21:26:28 -!- djino [~djino__@91.218.156.245] has quit [Remote host closed the connection] 21:26:52 -!- schmir [~schmir@p54A90832.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 21:29:38 Adamant [~Adamant@unaffiliated/adamant] has joined #scheme 21:34:35 bgs100 [~ian@unaffiliated/bgs100] has joined #scheme 21:47:33 seangrove [~user@c-71-198-44-87.hsd1.ca.comcast.net] has joined #scheme 21:49:36 -!- kuribas [~user@d54C2AFD1.access.telenet.be] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 21:50:09 stis [~stis@1-1-1-39a.veo.vs.bostream.se] has joined #scheme 21:50:38 schmir [~schmir@p54A90832.dip0.t-ipconnect.de] has joined #scheme 21:52:41 -!- pumpkin [~pumpkin@131.247.67.79] has quit [Quit: Computer has gone to sleep.] 21:54:24 homie [~user@xdsl-87-79-140-119.netcologne.de] has joined #scheme 21:56:57 Hey cky, remember me from yesterday? I had a question about your implementation. My code seems to return (cons 'a 'b) but yours returns (cons (quote a) (quote b)) .. how did you get the "quote" in there? 21:57:36 wbooze [~user@xdsl-87-79-140-119.netcologne.de] has joined #scheme 21:58:22 'a and (quote a) are two different spellings for the same thing. 21:58:41 Is there any way I can force it to return quote instead of ' 21:58:44 You can use either as input, and which is printed on output depends on which Scheme you are using. 21:58:54 Ah I see 21:58:58 That too depends on your particular Scheme implementation. 21:59:45 Schemers (and Lispers, too) very quickly get used to seeing them as interchangeable, like "color" and "colour", only even more so. 22:00:43 -!- Ragnaroek [~chatzilla@pD951ED35.dip.t-dialin.net] has quit [Ping timeout: 240 seconds] 22:01:50 -!- dfkjjkfd [~paulh@236-9-ftth.onsnetstudenten.nl] has quit [Quit: Lost terminal] 22:07:01 Axsuul: What jcowan said. 22:07:10 Axsuul: Also, ' is _much_ more commonly seen than "quote". 22:07:17 Axsuul: I certainly know which one I prefer to see! 22:07:51 (Hint: The character next to my tab key. Hint 2: I use Dvorak.) 22:10:33 Well, mostly so do I, though it can cause confusion on occasion. Consider this datum (not code): ((a "a") (b "b") ... (quote "quote") ...). Two element lists except for a '"quote" in there. 22:10:34 Axsuul: However, if you like, I'll be happy to review your code, if I'm still here by the time you respond. 22:11:01 Axsuul: Try: (list (car ''x) (car '(quote x)) (equal? ''x '(quote x))) 22:11:15 rudybot: (let ((quote "quote")) quote) 22:11:15 cky: ; Value: "quote" 22:11:26 jcowan: Seems to work for me. :-) 22:11:40 Axsuul: Try: (list '' 'quote (car ''x) (car '(quote x)) (equal? ''x '(quote x))) 22:11:50 Erm '' won't work. 22:12:00 rudybot: (list 'quote (car ''x) (car '(quote x)) (equal? ''x '(quote x))) 22:12:00 pjb: your r5rs sandbox is ready 22:12:01 pjb: ; Value: {quote quote quote #t} 22:12:50 rudybot: (let ('"quote") quote) 22:12:51 cky: ; Value: "quote" 22:12:51 rudybot: (list 'quote ''x (car ''x) (car '(quote x)) (equal? ''x '(quote x))) 22:12:52 pjb: ; Value: {quote {quote x} quote quote #t} 22:12:57 That's too awesome. 22:13:29 rudybot: (let (`"quasi" ,"unquote") (values quasiquote unquote)) 22:13:29 cky: ; Value: "quasi" 22:13:30 cky: ; Value#2: "unquote" 22:13:34 \o/ 22:14:34 cky: you've got two points toward the obfuscated scheme contests. 22:14:40 pjb: Thanks! :-D 22:22:03 rudybot: (let (`display ,/) `,42) 22:22:03 cky: ; stdout: "1/42" 22:23:56 imran_sr [~imran@75-18-254-4.lightspeed.uncyca.sbcglobal.net] has joined #scheme 22:25:00 cky: Ah sorry, I'm back, let me show you what I have for pairs 22:25:13 Axsuul: Use paste.lisp.org if you can. :-) 22:25:20 Will do! 22:27:00 -!- firecrow8 [~fcrow@69.38.169.34] has left #scheme 22:28:42 rudybot: (require srfi/1) 22:28:43 cky: Done. 22:29:22 rudybot: (apply atan (map - (iota 2))) ; how to write pi, without any of the digits in 3.14159 :-) 22:29:22 cky: I know that when I was writing C at school, my twb-macro-fu.h defined an iota macro 22:29:27 rudybot: eval (apply atan (map - (iota 2))) ; how to write pi, without any of the digits in 3.14159 :-) 22:29:28 cky: ; Value: 3.141592653589793 22:32:11 HG` [~HG@xdsl-92-252-105-72.dip.osnanet.de] has joined #scheme 22:33:41 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 255 seconds] 22:39:02 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 22:39:40 Axsuul pasted "expr" at http://paste.lisp.org/display/116571 22:39:46 cky: ^ 22:45:42 -!- schmir [~schmir@p54A90832.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 22:50:02 -!- choas [~lars@p5792C0FE.dip.t-dialin.net] has quit [Quit: leaving] 22:53:05 mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #scheme 23:01:05 -!- jcowan [c6b912cf@gateway/web/freenode/ip.198.185.18.207] has quit [Ping timeout: 265 seconds] 23:11:03 -!- seangrove [~user@c-71-198-44-87.hsd1.ca.comcast.net] has quit [Remote host closed the connection] 23:11:26 seangrove [~user@c-71-198-44-87.hsd1.ca.comcast.net] has joined #scheme 23:16:27 -!- bgs100 [~ian@unaffiliated/bgs100] has quit [Read error: Connection reset by peer] 23:16:59 bgs100 [~ian@unaffiliated/bgs100] has joined #scheme 23:29:06 anyone up for a riddle? 23:29:22 -!- stis [~stis@1-1-1-39a.veo.vs.bostream.se] has quit [Remote host closed the connection] 23:30:07 Caleb pasted "riddle" at http://paste.lisp.org/display/116574 23:30:20 well, not much of a riddle 23:30:39 "Compute (fact-mod (- n 1) n) on a large random sample of numbers. Can you guess what this value is? For which n it is equal 0? " 23:31:01 i wrote a small function (check) that computes it up to n = 100 23:31:26 it seems to be non-zero for values of n that are prime 23:31:51 Axsuul: Okay, you had the right idea. I'll send you my answer so you can compare. (Don't copy my answer verbatim, of course.) 23:31:59 but i don't know how to describe the value that is actually outputted (a number that is smaller than 1 from the prime number?) 23:32:42 cky pasted "mutable2" at http://paste.lisp.org/display/116575 23:35:25 Caleb--: Well. Pretty obvious, really. 23:35:42 Caleb--: When n is prime, then there are no common factors between fact(n-1) and n. 23:36:53 Caleb--: And when n is not prime, then there will be at least some common factors between fact(n-1) and n. 23:41:06 yeah 23:41:29 but what is the value that is returned when n is prime? 23:42:00 it seems to return (n - 1) 23:42:21 dfkjjkfd [~paulh@236-9-ftth.onsnetstudenten.nl] has joined #scheme 23:44:25 cky: thanks, ill take a look 23:48:09 cky, the exception seems to be 4 23:50:10 -!- fradgers- [~fradgers-@5e064cc1.bb.sky.com] has left #scheme 23:53:18 cky: what does the "@" symbol signify? 23:54:02 Unquote splicing. :) 23:54:08 (Yes, I had no idea either) 23:55:32 Ahh :) 23:55:35 -!- hotblack23 [~jh@p57B59D19.dip.t-dialin.net] has quit [Quit: Leaving.] 23:55:36 *Axsuul* writes that down in his wiki 23:56:17 :D 23:57:50 Basically, it "strips" the parentheses from a list inside a backquoted area, or something 23:58:01 Google can tell you much more accurately :) 23:58:21 (I just suddenly realised I should give some kind of basic explanation, at leas( 23:58:33 s/leas(/least)/ 23:59:24 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 265 seconds]