00:15 (join) saint_cypher 00:47 (quit) kitten: Quit: I hate lopy! 01:19 (quit) dnolen: Quit: dnolen 01:24 (quit) jonrafkind: Ping timeout: 276 seconds 01:34 (quit) saint_cypher: Ping timeout: 264 seconds 01:44 (join) dnolen 01:51 (join) alcuadrado 01:51 alcuadrado: Is there any (runtime) implementation in racket? 02:07 alcuadrado: (current-milliseconds) 02:28 (quit) dnolen: Quit: dnolen 03:22 (quit) ckrailo: Quit: Computer has gone to sleep. 03:35 (quit) alcuadrado: Ping timeout: 255 seconds 03:50 (join) PLT_Notify 03:50 PLT_Notify: racket: master Matthew Flatt * 0ec4c3a (1 files in 1 dirs): cocoa: fix initialization of screen bitmaps 03:50 PLT_Notify: racket: master Matthew Flatt * 2b38275 (1 files in 1 dirs): make test suite hit tab panels more 03:50 PLT_Notify: racket: master Matthew Flatt * 3249ca2 (2 files in 2 dirs): cocoa: fix bug in PSMTabBarControl 03:50 PLT_Notify: racket: master Matthew Flatt * a5a7076 (6 files in 5 dirs): `file-or-directory-permissions': expose more info, add write mode ... 03:50 PLT_Notify: racket: master Matthew Flatt * 2ba8927 (1 files in 1 dirs): cocoa: flip vertical slider direction 03:50 PLT_Notify: racket: master Matthew Flatt * 051ec47 (1 files in 1 dirs): gtk: fix slider value display 03:50 PLT_Notify: racket: master commits 7378c2e...051ec47 - http://bit.ly/ig3MNn 03:50 (part) PLT_Notify 03:51 (join) mceier 03:56 (join) lucian 03:59 (join) masm 04:30 (quit) lucian: Remote host closed the connection 04:34 (quit) masm: Ping timeout: 250 seconds 04:38 (quit) misterm: Ping timeout: 276 seconds 05:30 (quit) martinhex: Read error: Connection reset by peer 06:06 (quit) evhan: Ping timeout: 250 seconds 06:09 (join) evhan 06:28 (quit) DT``: Ping timeout: 246 seconds 06:40 (join) DT`` 06:48 (join) PLT_Notify 06:48 PLT_Notify: racket: master Eli Barzilay * a18197f (1 files in 1 dirs): Add a warning about the current state of racket/stream. 06:48 PLT_Notify: racket: master Eli Barzilay * 5a9d954 (12 files in 1 dirs): Several typos from Jussi Salmela. Fixes PR 11790 -- all typos. ... 06:48 PLT_Notify: racket: master commits 051ec47...5a9d954 - http://bit.ly/hQur5s 06:48 (part) PLT_Notify 07:04 (join) masm 09:01 (join) dnolen 09:01 (quit) dnolen: Excess Flood 09:07 (join) dnolen 09:33 (join) jao 09:33 (quit) jao: Changing host 09:33 (join) jao 09:42 (join) PLT_Notify 09:42 PLT_Notify: racket: master Matthew Flatt * ae87056 (1 files in 1 dirs): scribble/eval: fix evaluation of literal #f expression ... 09:42 PLT_Notify: racket: master Matthew Flatt * 5afacbb (2 files in 2 dirs): fix `pretty-print' confusion about quasiquote ... 09:42 PLT_Notify: racket: master commits 5a9d954...5afacbb - http://bit.ly/gO4oOk 09:42 (part) PLT_Notify 10:11 (join) lucian 10:19 (join) MayDaniel 10:39 (join) lisppaste 11:15 (quit) jao: Ping timeout: 255 seconds 11:21 (join) ckrailo 11:42 (join) anRch 11:50 (quit) Demosthenes: Quit: leaving 12:03 (join) shader 12:05 shader: can you have the same regex cluster capture mulitple copies of the same pattern? 12:14 (quit) anRch: Quit: anRch 12:14 (join) jonrafkind 12:28 (join) anRch 12:34 (quit) anRch: Read error: Connection reset by peer 12:35 (join) anRch 12:49 (join) anRch_ 12:49 (quit) anRch: Ping timeout: 240 seconds 12:49 (nick) anRch_ -> anRch 12:51 (quit) shader: Ping timeout: 255 seconds 13:00 (quit) anRch: Quit: anRch 13:02 (join) samth_ 13:03 samth_: eli: please approve my message to announce 13:03 (part) samth_ 13:08 (quit) lucian: Remote host closed the connection 13:43 (join) shader 14:01 (quit) abbe: Quit: /quit 14:05 (join) abbe 14:08 (quit) shader: Ping timeout: 276 seconds 14:09 (quit) abbe: Quit: /quit 14:11 (join) abbe 14:12 (join) anRch 14:21 (join) PLT_Notify 14:21 PLT_Notify: racket: master Matthew Flatt * 449a634 (0 files in 0 dirs): add missing test for commit ae8705611ba3ff03 - http://bit.ly/g7Li1W 14:21 (part) PLT_Notify 14:25 (quit) abbe: Quit: /quit 14:26 eli: samth: ? 14:30 (join) abbe 15:05 (quit) abbe: Changing host 15:05 (join) abbe 15:17 (quit) anRch: Quit: anRch 15:31 (join) saint_cypher 15:32 clklein: Out of curiosity, anyone know the origin of the (define (((f x) y) z) ...) notation? 15:32 clklein: Are there other Schemes that support it? 15:33 mario-goulart: chicken does. 15:34 eli: IIRC, MIT Scheme was doing it for ages. 15:35 mario-goulart: I think they are called curried definitions. 15:36 clklein: thanks 15:41 (join) PLT_Notify 15:41 PLT_Notify: racket: master Eli Barzilay * 0108955 (1 files in 1 dirs): Add comment on how to make interactions use syntax values. ... - http://bit.ly/hyXipK 15:41 (part) PLT_Notify 16:01 (join) tauntaun 16:05 (join) jao 16:08 qha: clklein: Thanks for asking about that, I hadn't seen that syntax before. Very handy! 16:11 (quit) mceier: Quit: leaving 16:14 (join) dining_philosoph 16:14 dining_philosoph: hello!1 16:15 dining_philosoph: i have some bug in my racket 16:16 dining_philosoph: > 0.1 0.0 > 0.1 0.9 0.0 0.0 > 1.3 1.0 > -4.5 -4.0 > 1.54 1.0 > (/ 1.54 5.5) 0,2.0 > (/ 1.54 5.545) 0,2.0 > (/ 451.54 56.545) 8,053571428571429.0 > 16:16 dining_philosoph: here it is 16:17 bremner: dining_philosoph: use a pastebin? 16:17 dining_philosoph: whats ths 16:17 dining_philosoph: i use web interface http://racket-lang.org/irc-chat.html 16:18 bremner: e.g. paste.lisp.org for large pieces of text 16:19 dining_philosoph: bloody hell 16:19 bremner: otherwise we can try to guess what that one long line meant. 16:19 dining_philosoph: i am not familiar with irc 16:20 dining_philosoph: wait a minute 16:20 bremner: what version of racket are you running? 16:20 dining_philosoph: 5.1 from ppa on launchpad.com 16:20 bremner: oh, you can blame jonrafkind if it doesn't work then ;) 16:21 jonrafkind: oh boy 16:21 bremner: and what language setting? 16:21 dining_philosoph: http://paste.lisp.org/display/120430 16:21 dining_philosoph: russian locale 16:21 dining_philosoph: ubuntu 10.10 16:21 jonrafkind: are you running racket on the command line? 16:21 jonrafkind: or drracket 16:21 dining_philosoph: racket language 16:21 jonrafkind: the gui 16:21 bremner: I mean the #lang line 16:21 dining_philosoph: drracket 16:21 dining_philosoph: #lang scheme 16:22 bremner: hmm. I don't have that, also running 5.1 16:22 jonrafkind: what if you try #lang racket 16:23 dining_philosoph: i suspect russian language matters because it uses comma as decimal separator 16:23 jonrafkind: im confused as to what 8,053571428571429.0 is 16:23 jonrafkind: are there a bunch of numbers between the , and the . ? 16:24 jonrafkind: i mean why are there 16:24 dining_philosoph: , is a decimal separator 16:24 dining_philosoph: in russian locale 16:25 jonrafkind: so in english it would be 8.053571428571429 16:25 dining_philosoph: with #lang racket i have the same results 16:25 jonrafkind: and then whats the .0 ? 16:25 dining_philosoph: yes 16:25 dining_philosoph: .0 is a bug as i can understand 16:25 bremner: hmm. I just switched drracket to russion, I think. but I get 7.985498275709612 for the last expression. 16:25 jonrafkind: oh yes it seems so 16:26 jonrafkind: what does (/ 500000 2) print for you? 16:26 dining_philosoph: 250000 16:26 jonrafkind: with no commas or anything? 16:26 dining_philosoph: no, just 250000 16:27 jonrafkind: what about the command line, just run racket 16:28 dining_philosoph: drscheme 16:28 jonrafkind: what? 16:28 jonrafkind: do you know what the command line is? 16:28 dining_philosoph: command line is drscheme 16:29 dining_philosoph: yes 16:29 jonrafkind: use the unix command line 16:29 jonrafkind: and run 'racket' 16:29 jonrafkind: it will give you a prompt 16:29 dining_philosoph: aha 16:29 dining_philosoph: it hsn't this bug 16:30 dining_philosoph: > 2.55 16:30 dining_philosoph: 2.55 16:30 jonrafkind: (/ 451.54 56.545) 16:30 jonrafkind: and this one? 16:30 dining_philosoph: 7.985498275709612 16:30 dining_philosoph: right 16:31 jonrafkind: so drracket is completely broken 16:31 jonrafkind: very strange 16:31 jonrafkind: does it work if you cahnge the locale? 16:32 dining_philosoph: russian colleague advised me to do export LANG=C before launch 16:32 dining_philosoph: is this what you mean? 16:33 jonrafkind: yea 16:33 dining_philosoph: > 54.0234 16:33 jonrafkind: what was your LANG before? 16:33 dining_philosoph: 54.0234 16:34 jonrafkind: and thats in drracket, not the unix command line right? 16:34 dining_philosoph: yes 16:34 dining_philosoph: what LANG? 16:35 jonrafkind: yes, what was it before you changed it 16:35 dining_philosoph: i don't know how to see it 16:36 jonrafkind: echo $LANG 16:36 (join) apgwoz 16:36 dining_philosoph: ru_RU.utf8 16:37 jonrafkind: bremner, did you get this error when you tried the russian locale "Gtk: Locale not supported by C library." 16:38 jonrafkind: anyway using that locale I still get the right results 16:38 jonrafkind: but im using a newer version of racket than what the ppa has 16:38 jonrafkind: so I guess use LANG=C when you run drracke/drscheme 16:38 dining_philosoph: thank you 16:39 dining_philosoph: i hope that new version will not have this issue 16:41 jonrafkind: it doesnt seem to so far 17:34 (quit) dining_philosoph: Quit: Page closed 17:47 (quit) tauntaun: Quit: Ex-Chat 17:48 clklein: qha: If you like that, you may also like `curry' (and occasionally also `curryr') 17:57 (join) shofetim 18:32 qha: clklein: Yes, I'd stumbled across them and made a mental note to look into them at some later time. The define syntax was just so intuitive that I had to try it right away. 18:36 (join) Senjai 18:36 Senjai: Hey all 18:36 Senjai: Hey Lajla 18:36 Lajla: I am a caterpillar, waiting to mature to a butterfly on a leaf of knowledge. 18:36 Lajla: Damn 18:36 (join) mithos28 18:36 Lajla: so poetic. 18:37 Lajla: Just a shame those caterpillar things are getting old. 18:37 Senjai: haha 18:38 Lajla: Looks like blizzard is backing off from the khaydarin nerf though. 18:38 Lajla: Thank god they start to realize the madness. 18:38 Lajla: Like when they wanted fungal growth to no longer hit air units. 18:38 Lajla: Who thinks of that 18:43 (quit) MayDaniel: Read error: Connection reset by peer 18:49 Senjai: lol 18:49 Senjai: are you happy? 18:54 Senjai: rudybot: build-list 18:54 rudybot: Senjai: eh? Try "rudybot: help". 18:54 Senjai: rudybot (build-list) 18:54 Senjai: rudybot: (build-list) 18:54 rudybot: Senjai: your sandbox is ready 18:54 rudybot: Senjai: error: procedure build-list: expects 2 arguments, given 0 18:55 (join) Somelauw 18:56 Lajla: Senjai, want to know how it works? 18:56 Senjai: Yea lol' 18:56 Lajla: rudybot, (build-list values 10) 18:56 rudybot: Lajla: your sandbox is ready 18:56 rudybot: Lajla: error: build-list: expected argument of type ; given # 18:57 Lajla: Ehh 18:57 Lajla: rudybot, (build-list 10 values) 18:57 rudybot: Lajla: ; Value: (0 1 2 3 4 5 6 7 8 9) 18:57 Lajla: Cool 18:57 Lajla: Senjai, basically, it takes a natural number and a procedure 18:57 Lajla: Basically, see it as first making a list of 0 ... that numer and then mapping the procedure over it. 18:57 Senjai: values? 18:57 Lajla: Senjai, values is essentially the identity function 18:58 Lajla: the function that does nothing with its input 18:58 Lajla: rudybot, (values 1) 18:58 rudybot: Lajla: ; Value: 1 18:58 Lajla: rudybot, (values 1 2 3) 18:58 rudybot: Lajla: ; Value: 1 18:58 rudybot: Lajla: ; Value#2: 2 18:58 rudybot: Lajla: ; Value#3: 3 18:58 Senjai: rudybot: (define (f x) (* x 2)) 18:58 rudybot: Senjai: Done. 18:58 Lajla: (procedures in racket are capable of returning multiple values) 18:58 Senjai: (build-list 10 f) 18:58 Senjai: rudybot: (build-list 10 f) 18:58 rudybot: Senjai: ; Value: (0 2 4 6 8 10 12 14 16 18) 18:58 Senjai: like that? 18:58 Lajla: Indeed 18:59 Senjai: rudybot: (build-list 10 (lambda (n) (* n n n))) 18:59 rudybot: Senjai: ; Value: (0 1 8 27 64 125 216 343 512 729) 18:59 Senjai: so the natural is the # of lists 18:59 Somelauw: (doc build-list) 18:59 Somelauw: Lajla: (doc build-list) 18:59 Lajla: rudybot, (define (range from to) (if (> to from) (cons from (range (add1 from) to)) '())) 18:59 rudybot: Lajla: Done. 18:59 Lajla: rudybot, (range 0 10) 18:59 rudybot: Lajla: ; Value: (0 1 2 3 4 5 6 7 8 9) 19:00 Lajla: rudybot, (range 5 9) 19:00 rudybot: Lajla: ; Value: (5 6 7 8) 19:00 Senjai: rudybot: (doc I dont get your '() 19:00 rudybot: Senjai: why? even the doc says that it can become slow... 19:00 Lajla: rudybot, (define (build-list to proc) (map proc (range 0 to))) 19:00 rudybot: Lajla: Done. 19:00 Senjai: rudybot: (doc build-list) 19:00 rudybot: Senjai: error: reference to undefined identifier: doc 19:00 Somelauw: why are the bots both executing? 19:00 Senjai: huh? 19:00 Senjai: Somelauw: what do you mean 19:00 Lajla: THere is only one bot. 19:01 (join) DT-sama 19:01 (quit) DT``: Ping timeout: 240 seconds 19:01 (nick) DT-sama -> DT`` 19:01 DT``: rudybot, (define fib(let*((√5 (inexact->exact (sqrt 5)))(φ (/ (add1 √5) 2)))(lambda (n)(round (/ (- (expt φ n) (expt (sub1 φ) n)) √5))))) 19:01 rudybot: DT``: ; stdout: "10" 19:01 Somelauw: Lajla: Nevermind, I though you were a both as well :P 19:01 Senjai: lol 19:01 DT``: rudybot, (fib 2) 19:01 rudybot: DT``: ; Value: 1 19:01 Lajla: It happens. 19:02 Senjai: rudybot, (tabulate sin 5) 19:02 rudybot: Senjai: error: reference to undefined identifier: tabulate 19:02 Senjai: what does a tabulate function do? 19:03 Somelauw: print nums from 1 to 5 and its sin probably 19:03 Somelauw: or from 0 to 4 instead of 1 to 5 19:05 qha: rudybot: (require srfi/1) 19:05 rudybot: qha: your sandbox is ready 19:05 rudybot: qha: Done. 19:05 qha: rudybot: (list-tabulate sin 5) 19:05 rudybot: qha: error: list-tabulate: given # 19:06 qha: rudybot: (list-tabulate 5 sin) 19:06 rudybot: qha: ; Value: (0 0.8414709848078965 0.9092974268256817 0.1411200080598672 -0.7568024953079282) 19:06 Somelauw: I didn't know about built-list function. It looks a bit like iota. 19:06 jonrafkind: for/list is usually easier to use 19:06 qha: rudybot: help 19:06 rudybot: qha: help [], version, quote, source, seen , uptime, t8 ..., init [], eval ..., give ..., apropos ..., desc , doc , later "tell" ... 19:07 Senjai: Lajla: Can you help me with this problem? 19:07 qha: rudybot: help sandbox 19:07 rudybot: qha: help [], version, quote, source, seen , uptime, t8 ..., init [], eval ..., give ..., apropos ..., desc , doc , later "tell" ... 19:07 qha: rudybot: (quit) 19:07 rudybot: qha: error: reference to undefined identifier: quit 19:08 Lajla: Senjai, which problem? 19:08 qha: rudybot: (exit) 19:08 rudybot: qha: error: evaluator: terminated (exited) 19:08 Senjai: Lajla: http://codepad.org/Ie7oBtU7 19:08 Senjai: Lajla: I think i have to use (build-list) to simplify it. 19:10 Somelauw: for/list is just map 19:10 (quit) mithos28: Quit: mithos28 19:10 Lajla: Senjai, how much am I allowed to help you? =P 19:11 Lajla: It's hard to give you a push in the right direction here, it's really easy once you see it. 19:11 Lajla: But let me try this 19:11 Senjai: Lajla: I know its not build list 19:11 Senjai: Because.. its just not 19:11 Lajla: what do you have to apply to 0 to get (posn 0 0) ? 19:11 Lajla: And what to 1 to get (posn 1 1) 19:12 (join) mithos28 19:12 Lajla: I mean, you want (list (posn 0 0) (posn 1 1) (posn 2 2) (posn 3 3)) for instance if you apply it to 2 rigt? 19:12 Senjai: (list (make-posn 0 0)) 19:12 Lajla: Remember how you created your list of squares 19:12 Lajla: Or doubles* 19:12 Lajla: (build-list double 9) 19:12 Senjai: rudybot: (buildlist 10 sqr) 19:12 rudybot: Senjai: your sandbox is ready 19:12 rudybot: Senjai: error: reference to undefined identifier: buildlist 19:12 Senjai: rudybot: (build-list 10 sqr) 19:12 rudybot: Senjai: ; Value: (0 1 4 9 16 25 36 49 64 81) 19:12 Lajla: Yeah 19:13 Lajla: So, how do you get a list of the first ten posns? 19:13 Lajla: Diagonally? 19:13 Senjai: but I cant use (build-list 10 make-pons) 19:13 Senjai: Id have to use a lambda 19:13 Senjai: or something 19:13 Lajla: Or define another function 19:13 Senjai: ok 19:13 Senjai: lets see 19:13 Lajla: What you want is a function 19:13 Senjai: hold on 19:13 Lajla: that takes in x 19:13 Senjai: Stop ! :) let me see if i can do this :P 19:13 Lajla: Sure 19:15 Senjai: ctual value (list (make-posn 0 0) (make-posn 1 1)) differs from (list (make-posn 2 2) (make-posn 1 1)), the expected value. at line 13, column 0 19:15 Senjai: I need it to go in decending value 19:15 Senjai: not ascending 19:16 Senjai: Lajla: This is the code I used 19:16 Senjai: http://codepad.org/eAUnDm05 19:16 Lajla: Very nice. 19:16 Lajla: All that remains is maybe applying reverse at the end 19:16 Lajla: if it needs to go in reverse 19:17 Lajla: I'd do (define (generate n) (reverse (build-list n (lambda (x) (posn x x))))) 19:18 Senjai: Thats what I would 19:18 Senjai: but look 19:18 Somelauw: You can't build a list of nums with for/list, right? 19:18 Senjai: (generate 10) (list (make-posn 9 9) (make-posn 8 8) (make-posn 7 7) (make-posn 6 6) (make-posn 5 5) (make-posn 4 4) (make-posn 3 3) (make-posn 2 2) (make-posn 1 1) (make-posn 0 0)) > 19:18 Senjai: Thats the result 19:18 Senjai: I need it to create the 10th posn, and excluse the 0th pson 19:18 Senjai: posn* 19:19 Senjai: how can I use the built in functions to do that 19:19 Lajla: Ahhh 19:19 Lajla: Just use (lambda (x) (posn (add1 x) (add1 x)) ? =P 19:19 Lajla: Before the reverse? 19:19 Senjai: ugh that'd make sense 19:20 Senjai: but it would include (make-posn 0 0) 19:22 Senjai: How do I get rid of that 0th one 19:23 Somelauw: I like (iterate + 0) in clojure. 19:23 Lajla: Senjai, no, it wouldn't. 19:23 Senjai: Ok Ill try 19:23 Lajla: It would get 0 and perform add1 on it. 19:23 Lajla: So get 1 19:24 Senjai: Omg 19:24 Senjai: dug 19:24 Senjai: Duh 19:24 Senjai: even though you add1 to n 19:24 Senjai: you dont add it to the recursion 19:24 Senjai: Final code: http://codepad.org/llbiKl6x Lajla 19:26 Lajla: THat seems to work 19:26 Lajla: Senjai, as an extra thing, you can actually replace the lambda with (compose posn-maker add1) 19:27 Senjai: what does (compose) do? 19:27 Lajla: ehhh 19:27 DT``: ((compose f g) x) -> (f (g x)) 19:27 Lajla: Yeah 19:28 Lajla: It takes an arbitrary amount of functions and returns the composition 19:28 Lajla: function pipeline, basically. 19:28 Senjai: Wow 19:28 Lajla: Like ehh 19:28 Senjai: The more I learn about Scheme the more powerful I think it becomes 19:28 Somelauw: compose is cool 19:28 DT``: rudybot, ((compose - sqrt) 4) 19:28 rudybot: DT``: ; Value: -2 19:28 Somelauw: does scheme have an iterate function. 19:28 Lajla: Senjai, remember what I told you about that scheme functions can return multiple values? 19:28 DT``: Somelauw, iterate function? 19:28 Senjai: Lajla: yea, but i dont exactly get it 19:29 DT``: rudybot, (values 2 3) 19:29 rudybot: DT``: ; Value: 2 19:29 rudybot: DT``: ; Value#2: 3 19:29 Somelauw: Yes, like (iterate + 0) is an infine list (0 1 2 3 4 5 6 7 8 ...) 19:29 Lajla: rudybot, (define (return-in-reverse x y) (values y x)) 19:29 rudybot: Lajla: your sandbox is ready 19:29 rudybot: Lajla: Done. 19:29 DT``: rudybot, (partition even? '(0 1 2 3 4 5 6 7 8 9 10)) 19:29 rudybot: DT``: ; Value: (0 2 4 6 8 10) 19:29 rudybot: DT``: ; Value#2: (1 3 5 7 9) 19:29 Lajla: rudybot (return-in-reverse 'a 'b) 19:29 Lajla: Do it, bitch 19:29 Lajla: rudybot, (return-in-reverse 'a 'b) 19:29 rudybot: Lajla: ; Value: b 19:30 rudybot: Lajla: ; Value#2: a 19:30 DT``: Somelauw, is that something from clojure? 19:30 (quit) mithos28: Quit: mithos28 19:30 Lajla: THat function returns two values. 19:30 Lajla: And you can use that in compose 19:30 Lajla: rudybot, ((compose / return-in-reverse) 7 3) 19:30 rudybot: Lajla: ; Value: 3/7 19:30 DT``: wait. 19:30 DT``: WAIT. 19:30 DT``: I didn't knew that. 19:31 Lajla: DT``, bet you didn't know this either: 19:31 Lajla: rudybot, (compose) 19:31 rudybot: Lajla: ; Value: # 19:31 Lajla: the composition of no function at all is values. 19:31 Lajla: the variadic identity function. =P 19:31 DT``: so. 19:31 DT``: it basically wraps everything in call-with-values? 19:32 Lajla: DT``, yeah. 19:32 Somelauw: DT``: yes 19:32 DT``: now compose is even more awesome. 19:32 Lajla: I guess it does internally. 19:32 Lajla: DT``, of course. 19:32 Somelauw: DT``: but haskell got it too 19:32 DT``: and now I have to rewrite lots of macros. 19:32 Senjai: Lajla: Im reading. 19:32 Lajla: In Haskell functions can't return multiple values. 19:32 Senjai: Oh I see what you mean 19:32 Senjai: so.. 19:33 Lajla: ((/) . f) basically just curries (/) 19:33 Somelauw: Lajla: Yes they can 19:33 Senjai: rudybot, (define (return-in-reverse x y) (values y x)) 19:33 rudybot: Senjai: your sandbox is ready 19:33 rudybot: Senjai: Done. 19:33 Somelauw: You can return structs or tuples 19:33 Lajla: Like I said 19:33 Somelauw: tuples are like values 19:33 Lajla: In Haskell functions can return multiple values. 19:33 Lajla: No they're not. 19:33 Senjai: rudybot, (return-in-reverse (list 1 2 3) (/ 2 3)) 19:33 rudybot: Senjai: ; Value: 2/3 19:33 rudybot: Senjai: ; Value#2: (1 2 3) 19:33 DT``: s/can/can't/ 19:33 Senjai: Lajla: Like that? 19:33 DT``: rudybot, (call-with-values (λ()(values 1 2 3 4)) +) 19:33 rudybot: DT``: ; Value: 10 19:34 Lajla: DT``, don't overcomplicate it yet. =P 19:34 Lajla: Senjai, but basically 19:34 Lajla: Most 'contexts' can only consume a single return value. 19:34 Lajla: rudybot, (+ (return-in-reverse 1 2) 3) 19:34 rudybot: Lajla: error: context expected 1 value, received 2 values: 2 1 19:34 Senjai: Unless it is set up to accept multiple return values? 19:34 Lajla: YEah 19:34 DT``: wait. 19:34 Lajla: You use call-with-values for that 19:34 DT``: is compose a function. 19:34 DT``: or a macro? 19:35 Lajla: DT``, funciton 19:35 DT``: rudybot, compose 19:35 rudybot: DT``: ; Value: # 19:35 Lajla: You can compose compose. 19:35 Lajla: rudybot, (compose compose +) 19:35 rudybot: Lajla: ; Value: # 19:35 DT``: how can can compose take multiple valu-wait, disregard that. 19:35 Somelauw: rudybot: (compose) 19:35 rudybot: Somelauw: your sandbox is ready 19:35 rudybot: Somelauw: ; Value: # 19:35 DT``: I'm just stupid. 19:35 DT``: rudybot, (letrec((x x))x) 19:35 rudybot: DT``: ; Value: # 19:36 Somelauw: That confuses me completely 19:37 Lajla: Senjai, anyway, how call-with-values works is like this: 19:37 Somelauw: x should be a function. 19:37 Somelauw: So it should return a function that returns itself. 19:37 Lajla: (call-with-values (lambda () ) ) 19:37 DT``: Somelauw, it *can* be a function. 19:37 DT``: rudybot, (letrec ((x 2)) x) 19:37 rudybot: DT``: ; Value: 2 19:37 Lajla: It then calls the random function with all the values that the random expression returns. 19:38 Somelauw: So it returns a local variable. 19:38 Senjai: Scary 19:38 Senjai: I dont get how you use lambda with () 19:38 DT``: letrec just bounds all the binding identifiers in their bodies. 19:38 Lajla: rudybot, (call-with-values (lambda () (return-in-reverse 1 5) (lambda (x y) (/ x y))) 19:38 rudybot: Lajla: rudybot (return-in-reverse 'a 'b) 19:38 DT``: defaulting their values to # in Racket. 19:38 Lajla: rudybot, (call-with-values (lambda () (return-in-reverse 1 5)) (lambda (x y) (/ x y))) 19:38 rudybot: Lajla: ; Value: 5 19:38 DT``: Senjai, it's a zero-arity function. 19:38 DT``: it takes 0 parameters. 19:38 Lajla: Senjai, yeah 19:39 DT``: rudybot, (define (f) 2) 19:39 rudybot: DT``: Done. 19:39 DT``: rudybot, (f) 19:39 rudybot: DT``: ; Value: 2 19:39 DT``: rudybot, ((lambda () 2)) 19:39 rudybot: DT``: ; Value: 2 19:39 Lajla: more formally, call-with-values takes two arguments, it calls the first argument with no arguments and then call the second argument with the amount of values than the first argument returns. 19:39 Lajla: Like ehh 19:39 Lajla: senja, (*) returns 1 19:39 Lajla: multiplication of nothing is 1. 19:40 Lajla: So you can do (call-with-values * add1) in theory 19:40 Lajla: to get 2 19:40 Senjai: Intersting 19:40 Senjai: What would you use it for 19:40 DT``: rudybot, (call-with-values * add1) 19:40 rudybot: DT``: ; Value: 2 19:40 Lajla: Senjai, well, to extract the values from a procedure that returns multiple values basically. 19:40 DT``: You can also use let[*]-values and letrec-values 19:41 Lajla: Sometimes you might want a procedure to return multiple values, or even cooler, depend on runtime information how many values they return. 19:41 DT``: and letrec-syntaxes+values. 19:41 Lajla: Yah 19:41 Senjai: Can scheme be used with OpenGL 19:41 Somelauw: In my opinion, you can already return multiple values using lists. 19:41 DT``: yes. 19:41 Lajla: Like, the construct (call-with-values (lambda () ) (lambda xs (length xs))) actually returns how much values returns. 19:41 Somelauw: And you can easily extract values from lists with apply. 19:42 Lajla: Somelauw, how do you differentiate between a list and multiple values? 19:42 Lajla: See the compose example. 19:42 Lajla: Some functions simply return a list. 19:42 Lajla: compose would have no way to semantically differentiate between which you mean. 19:42 DT``: Senjai, http://docs.racket-lang.org/sgl/index.html 19:42 DT``: what should partition return. 19:43 DT``: a list of two lists, or two values? 19:45 Somelauw: Lajla: I wouldn't differentate. 19:45 Senjai: Lajla: This looks tough http://codepad.org/gy9DNsq7 19:45 Somelauw: I can't find you compose example? 19:46 DT``: returning values can be optimized easier. 19:47 Senjai: Somelauw: you dont know how compose works? 19:47 Lajla: Somelauw, well, consider the function 'average' 19:47 Lajla: It takes two arguments, and returns its average. 19:47 Lajla: Say I want to compose this onto a function that returns two arguments 19:48 Lajla: If this just returned a list 19:48 Somelauw: I do know how compose works 19:48 Lajla: Yeah 19:48 Lajla: But if the function just returned a list 19:48 Lajla: this would't work. 19:48 Lajla: And even worse 19:48 Lajla: what if this function could return either 1 or more arguments depending on runtime info. 19:48 Lajla: And the average function was variadic itself. 19:49 Senjai: Lajla: Would i use filter for this problem? 19:50 Lajla: Senjai, yeah, basically. 19:50 Lajla: Just create a function that returns #f when it's inside of the boundaries 19:52 Somelauw: Lajla: Ah, not I get it. 19:53 (join) misterm 19:53 Somelauw: Lajla: Ah, now I get it. 19:53 Senjai: rudybot, (filter > (list 2 3 4) 2) 19:53 rudybot: Senjai: your sandbox is ready 19:53 rudybot: Senjai: error: procedure filter: expects 2 arguments, given 3: #> (2 3 4) 2 19:54 Somelauw: (very confusing type) Now, if the second argument to compose returns values, the first argument can consume them. 19:54 Lajla: Somelauw, an alternative solution would be to let every function always return a list but that is basically just displacing the issue. 19:54 Senjai: rudybot, (filter (lambda (n) (>= n 2)) (list 1 2 3 4)) 19:54 rudybot: Senjai: ; Value: (2 3 4) 19:54 Lajla: Somelauw, yeah 19:54 Lajla: Somelauw, a thing in haskell though is that everything is a tuple, so 3 is just a singleton tuple containing 3. 19:55 Lajla: Which does leave some space, problem being that the type system can't validate variable-arity tuples based on runtime decision 19:55 Somelauw: Yes. 19:55 Lajla: so you're still stuck with the function always returning n values. 19:56 Senjai: Lajla: http://codepad.org/7hNhBSdj can you tell me what Im doing wrong 19:56 Somelauw: Lajla: I know. Python does it very ugly (5,) is a tuple, but 5 is just a singleton. 19:56 Senjai: The checks fail 19:57 (join) jsnikeris 19:57 (quit) Somelauw: Quit: leaving 19:57 jsnikeris: hi all. what's the keybinding for "Run" in DrRacket? 19:57 DT``: C-t 19:58 Lajla: Senjai, your arguments are in the wrong order 19:58 Lajla: Love that you already start to use the variadic <= though 19:58 Senjai: I forgot 19:58 Senjai: I want the function to produce false 19:58 jsnikeris: Ahh, thanks 19:58 Lajla: Or ehh 19:58 Senjai: if those arguments are met so filter excludes it right? 19:58 Lajla: no arguments are right 19:58 Lajla: Yeah 19:59 Lajla: So just put not before it 19:59 Senjai: IsI just wrapped not around it 19:59 Senjai: yea 19:59 Senjai: ! 19:59 Senjai: WOO! 19:59 Senjai: :) 20:02 Senjai: [0, 10) means 0 <= x < 10 right? 20:03 Lajla: Quite so. 20:04 (quit) DT``: Read error: Connection reset by peer 20:05 Senjai: Next problem :( 20:06 Senjai: A natural number is any number... above 0 and whole? 20:06 Senjai: like 0 1 2 3 4 5 6 20:06 Lajla: Depending on to whom you speak, yea. 20:06 Lajla: Some people, like algebraists like to exclude 0. 20:08 (join) mithos28 20:10 jonrafkind: naturals are 1 and up 20:11 jonrafkind: x E Z | x > 0 20:11 Lajla: lol algebraist lol 20:11 Lajla: Russell disagrees 20:11 Lajla: when in doubt, consult Russell. 20:12 jonrafkind: kurt russell? 20:12 jonrafkind: big trouble in little china? 20:13 Lajla: No. 20:13 Lajla: Bertrand Russell. 20:13 Lajla: You know, the guy with the pipe. 20:13 Lajla: Who was like 'yo dawg, I heard you like sets, so we put all sets that are not in themselves in your sets so you can contract while you contradict' 20:15 jonrafkind: i use my own sets, F is the set of whole numbers starting from -48..+infinity but also includes 12.96 and 0.0001 20:15 Lajla: define 'infinity'. 20:16 jonrafkind: 12,000? 20:17 (quit) ckrailo: Quit: Computer has gone to sleep. 20:18 Lajla: jonrafkind, isn't that then a redundant definition? 20:19 Senjai: Lajla, do you know how to use (quicksort)? 20:19 Lajla: Senjai, ehh, how to implement it? 20:19 Senjai: Yes 20:19 Lajla: Yeah 20:19 Senjai: So how can I do what reverse does with quicksort 20:19 Lajla: What does reverse with quicksort? 20:20 Senjai: This is my code: http://codepad.org/gWU6RFbi 20:20 Lajla: THey're talking about functional programming on #starcraft again. 20:20 Lajla: Why don't you guys talk about starcraft here in revenge. 20:20 Senjai: It creates a list of rectangles, from the tallest to the shortest 20:20 (join) DT`` 20:20 Lajla: reverse does that? 20:20 (quit) masm: Quit: Leaving. 20:20 Senjai: Now I need to reverse the list, so it is ordered by width, but I cant to (reverse) I have to use one of the functions im given 20:21 Senjai: I know i need to order by (image-width) 20:21 Lajla: I don't follow 20:21 Senjai: Okay 20:22 Senjai: So right now my function, if you see it, creates a list of rectangles, sorted by decending height 20:22 Senjai: naturally according to the equation 20:22 Lajla: Go on. 20:22 Senjai: I now need it to sort it by ascending height, (or descending width) using quicksort 20:22 Senjai: ;; quicksort : (listof X) (X X -> boolean) -> (listof X) ;; to construct a list from all items on alox in an order according to cmp (define (quicksort alox cmp) ...) 20:23 Senjai: Lajla: Or any function according to http://htdp.org/2003-09-26/Book/curriculum-Z-H-27.html#node_sec_21.2 20:24 Senjai: Lajla: This is the question (C) By just using a different built in list function from Table 57 put the rectangles beside each other in a single image with the widest first. 20:26 Lajla: Hmm 20:26 Lajla: (X X -> Boolean) 20:26 (quit) DT``: Ping timeout: 255 seconds 20:26 Lajla: is your comparison function 20:27 Lajla: if you input < it sorts ascending 20:27 Lajla: if you input > it does descending 20:30 Senjai: How do i use quicksort? 20:31 Senjai: For foldr, howcome the function you use has to accept two arguments? 20:31 Senjai: (define (loi->image loi) (foldr (λ (i n) (beside/align "bottom" i n)) BLANK loi)) 20:32 Senjai: howcome it needs both i and n? 20:32 Senjai: I just guessed, Lucky I got it right 20:32 Senjai: (this function renders a (listof Image) beside eachother) 20:34 jonrafkind: one argument is from the list, the other argument is the accumulator 20:35 Senjai: Accumulator? 20:35 Senjai: ie, (cdr list) 20:35 Senjai: ? 20:35 Lajla: I don't get it. 20:36 jonrafkind: accumulator is a variable representing all the stuff you have computed thus far, it accumulates the computations 20:36 Lajla: it accumulates lots of lulz 20:36 jonrafkind: 1 + 2 + 3 + 4. start with 1 + 2 = 3, so you put 3 in the accumulator. now you have 3 + 3 + 4. 3 + 3 = 6, then finally 6 + 4. accumulator ends with 10 20:39 Senjai: oh 20:39 (join) DT`` 20:39 Senjai: Lajla: I got it to work, look at this: http://codepad.org/xwak3563 but I dont know why it works 20:40 Lajla: Senjai, why not? 20:40 Lajla: quicksort takes a list and a comparison and sorts it accordingly. 20:41 Senjai: How does it work though 20:41 Senjai: if you were to define quicksort, for example 20:41 Lajla: Ahhh 20:41 Lajla: let me try and implement that one. 20:44 Lajla: Senjai, http://codepad.org/5Qc0tUMY 20:46 (quit) jonrafkind: Ping timeout: 248 seconds 20:49 Senjai: There is a pivot function? 20:50 Senjai: rudybot, (values (list 1 2 3)) 20:50 rudybot: Senjai: ; Value: (1 2 3) 20:50 Senjai: values: name is not defined, not a parameter, and not a primitive name 20:51 Senjai: How can I extract the values out of a list 20:51 Senjai: its not defined within my language 20:56 Lajla: Senjai, no, there's not 20:56 (quit) dnolen: Quit: dnolen 20:56 Lajla: I used 'let' to bind 'pivot' to (car lst) 20:56 Senjai: oh 20:57 Senjai: duh 20:57 Senjai: howcome you dont use (define) 20:57 Lajla: Ehhh 20:57 Lajla: because let suffices in this case I get. =P 20:57 Lajla: And I used let* 20:57 Lajla: which means that the order of the bindings is sequential. 20:57 Lajla: So later definitions can reference things already bound. 20:57 DT``: using a (define) inside a (define) is equivalent to letrec. 20:58 DT``: it would work too. 20:58 DT``: and after confusing things again, I'm going to sleep. 20:58 DT``: 'night all. 20:59 Senjai: Night dt 20:59 Senjai: Lajla: lol check this outhttp://codepad.org/hsdMbK0G 20:59 Senjai: http://codepad.org/hsdMbK0G 21:00 Lajla: that's extremely vague. 21:00 Senjai: err 21:00 Senjai: Hold on 21:01 Senjai: Thats a little more clear http://codepad.org/4dSjbooZ Lajla 21:02 Lajla: Same link 21:02 Lajla: I don't get the problem 21:03 Senjai: Nether do i 21:03 Senjai: I have to create ONE function that can do all of the problems 21:04 Lajla: Which problemsn? 21:05 Senjai: Well I have to create an abstract function that can abstract over the templates and the function natfun, and fold 21:06 Lajla: Waht does 'abstract over' mean 21:06 Senjai: okay 21:07 Senjai: so like creating contains? to do what contains-number? and contains-string? both do 21:07 Senjai: with an extra argument to determine if it wants to test for a number or for a string 21:08 Senjai: map is an abstraction function 21:08 (join) dnolen 21:09 (quit) dnolen: Client Quit 21:10 jsnikeris: what's the keybinding for switching between the definitions area and the interactions area? 21:10 jsnikeris: I was expecting C-x o 21:10 jsnikeris: :/ 21:12 Senjai: Lajla: Ill brb in an hour or so 21:16 (quit) Senjai: Ping timeout: 245 seconds 21:20 (quit) DT``: Ping timeout: 255 seconds 21:22 (quit) saint_cypher: Quit: Leaving. 21:22 (quit) mithos28: Quit: mithos28 21:25 (join) mithos28 21:33 (join) DT`` 22:01 (join) Senjai 22:02 Senjai: Hey jao 22:02 Senjai: err 22:02 Senjai: Hey Lajla 22:02 Senjai: had to go with a frined and eat :/ 22:02 Lajla: rined? 22:02 Lajla: Ohh, friend 22:03 Lajla: freund 22:03 Senjai: lol 22:03 Senjai: Friend 22:03 Senjai: haha 22:03 Senjai: So think you can help with the whole abstraction function? 22:05 Lajla: I still have no idea what 'abstracting over' means. 22:06 Senjai: This explains it: http://codepad.org/5nnEk5Aw 22:06 Senjai: that was a question from a past midterm that asks the same question 22:06 (join) vdrab 22:07 Lajla: It doesn't explain what 'abstracting over' means. 22:08 Senjai: An abstraction of fold and natfun will be a function that can do both what fold and natfun can, in one function 22:08 Lajla: And what does natfun do? 22:09 Senjai: produces the sum of the first n natural numbers. 22:10 Senjai: whereas fold produces the sum of every item in the list 22:10 Senjai: Do you know enough C++ to know about inheritance? 22:10 Lajla: Yeah 22:10 Lajla: But fold doesn't do that. 22:11 Lajla: (fold + 0 lst) does that with a list. 22:11 Senjai: I know 22:11 Senjai: But inheritance is abstraction 22:11 Senjai: So the function, red, for instance, inherits both fold and natfun 22:12 Senjai: so red should be able to do what fold and natfun do 22:12 Lajla: that is extremely vague. 22:12 Lajla: Buy anyway, try this: 22:12 Senjai: i KNOW right? 22:12 Senjai: rudybot, (define (natfun fn b n) (cond [(zero? n) b] [else (fn n (natfun fn b (sub1 n)))])) 22:12 rudybot: Senjai: Done. 22:12 Lajla: (define (abstracted bool) (if bool fold natfun)) 22:12 Senjai: something like that 22:13 Senjai: but the abstracted function is supposed to have 6 inputs (what I dont understand) 22:13 Senjai: rudybot, (define (fold fn b lox) (cond [(empty? lox) b] [else (fn (first lox) (fold fn b (rest lox)))])) 22:13 rudybot: Senjai: Done. 22:15 Senjai: (define (abstraction fn1 fn2 b1 b2 lox n) 5) 22:15 Senjai: I think thats supposed to be what Im supposed to make 22:15 Senjai: where 5 is the body 22:23 Senjai: Lajla: ? 22:24 Lajla: I don't get it. 22:24 Lajla: It's too vague. 22:27 (quit) DT``: Read error: Connection reset by peer 22:27 Senjai: This was the answer to the midterm one. http://codepad.org/eDeeJx8k can you help explain it? 22:28 Senjai: In essence I know you have to define (fold) and (natfun) in terms of (red) 22:31 Lajla: No, I really don't get what it's supposed to do. 22:33 Senjai: (define (red fn base? next b v) can do both what fold does or natfun does 22:33 Senjai: look at the (define (fold)) and natfun below it 22:33 Senjai: both use red instead of fold 22:34 (quit) mithos28: Quit: mithos28 22:38 Lajla: Define 'does' 22:38 Lajla: Ohhh 22:38 Lajla: you mean 22:38 (part) jao: "Killed buffer" 22:38 Lajla: you want to exact the common part out of fold and natfun? 22:38 Lajla: Senjai, what did natfun do again? 22:40 Senjai: Produce the sum of the first n numbers 22:40 Senjai: rudybot, (define (sumnat n) (natfun 0 + n)) 22:40 rudybot: Senjai: Done. 22:41 Senjai: rudybot, define (sumnat 6) 22:41 rudybot: Senjai: ;; quicksort : (listof X) (X X -> boolean) -> (listof X) ;; to construct a list from all items on alox in an order according to cmp (define (quicksort alox cmp) ...) 22:41 Senjai: her 22:41 Senjai: err 22:41 (join) DT`` 22:41 Senjai: rudybot, (sumnat 6) 22:41 rudybot: Senjai: error: procedure application: expected procedure, given: 0; arguments were: 1 # 22:41 Senjai: rudybot, (natfun 0 + 6) 22:41 rudybot: Senjai: error: procedure application: expected procedure, given: 0; arguments were: 1 # 22:42 Senjai: rudybot, define (natfun fn b n) (cond [(zero? n) b] [else (fn n (natfun fn b (sub1 n)))])) 22:42 rudybot: Senjai: An abstraction of fold and natfun will be a function that can do both what fold and natfun can, in one function 22:42 Senjai: rudybot, (define (natfun fn b n) (cond [(zero? n) b] [else (fn n (natfun fn b (sub1 n)))]))) 22:42 rudybot: Senjai: An abstraction of fold and natfun will be a function that can do both what fold and natfun can, in one function 22:42 Senjai: ugh 22:42 Senjai: rudybot, (natfun + 0 6) 22:42 rudybot: Senjai: ; Value: 21 22:43 Senjai: there 22:43 Senjai: rudybot, (sumnat 6) 22:43 rudybot: Senjai: error: procedure application: expected procedure, given: 0; arguments were: 1 # 22:43 Senjai: rudybot, (define (sumnat n) (natfun + 0 n)) 22:43 rudybot: Senjai: Done. 22:43 Senjai: rudybot, (sumnat 6) 22:43 rudybot: Senjai: ; Value: 21 22:43 Lajla: Senjai, and this is called natfun 22:44 Lajla: What does natfun do? 22:44 Lajla: It takes three arguemnts I see. 22:44 (join) incandenza 22:44 Senjai: sums the first n numbers 22:44 Lajla: No it doesn 22:44 Lajla: 't 22:44 Senjai: err 22:44 Lajla: it takes 3 arguments 22:44 Lajla: What does (natfun - 0 n) do? 22:44 Lajla: Or (natfun - 7 n)? 22:45 Senjai: It does what fold does, but for numbers instead of a list 22:45 Lajla: Ah 22:45 Lajla: so: 22:45 Senjai: my bad 22:45 Senjai: rudybot, (natfun values 0 6) 22:45 rudybot: Senjai: error: context expected 1 value, received 2 values: 1 0 22:45 Senjai: rudybot, (natfun - 0 6) 22:45 rudybot: Senjai: ; Value: 3 22:46 Lajla: (define (natfun + from to) (fold + from (range (add1 from) to)) ? 22:46 Lajla: It works like that? 22:46 Senjai: uhh, I think so 22:46 Lajla: Ah 22:46 Senjai: Your sytax is hard for me to read 22:46 Lajla: So you need to make a function to define both natfun and fold in in a simple way? 22:47 Senjai: Yea 22:47 Lajla: Well 22:47 Lajla: fold then. 22:47 Lajla: (define fold fold) 22:47 Lajla: fold is the general function here 22:47 (quit) shachaf: Remote host closed the connection 22:47 Senjai: I think the function would have a definition of ;; X (X -> Boolean) X (X -> Y) (X -> Z) -> Z 22:47 Lajla: fold is strictly more general than natfun 22:48 Senjai: This was the answer for the last year midterm 22:48 Senjai: (define (red fn base? next b v) (cond [(base? v) b] [else (fn v (red fn base? next b (next v)))])) 22:49 Senjai: rudybot, (define (red fn base? next b v) (cond [(base? v) b] [else (fn v (red fn base? next b (next v)))])) 22:49 rudybot: Senjai: Done. 22:50 Senjai: rudybot, (red + zero? sub1 0 6) 22:50 rudybot: Senjai: ; Value: 21 22:50 Senjai: rudybot, (natfun + 0 6) 22:50 rudybot: Senjai: ; Value: 21 22:50 Senjai: see Lajla ? same, red is abstraction of natfun 22:50 Lajla: This is too vague to answer to. 22:51 Senjai: rudybot, (red + empty? rest empty (list 1 2 3)) 22:51 rudybot: Senjai: error: +: expects type as 1st argument, given: (3); other arguments were: () 22:53 Senjai: rudybot, (red (lambda (n a) (+ (first n) a)) empty? rest empty (list 1 2 3)) 22:53 rudybot: Senjai: error: +: expects type as 2nd argument, given: (); other arguments were: 3 22:55 Senjai: rudybot, (red (lambda (lox nrresult) (+ (first lox) nrresult)) empty? rest b (list 1 2 3)) 22:55 rudybot: Senjai: error: reference to undefined identifier: b 22:55 Senjai: rudybot, (red (lambda (lox nrresult) (+ (first lox) nrresult)) empty? rest 0 (list 1 2 3)) 22:55 rudybot: Senjai: ; Value: 6 22:55 Senjai: rudybot, (fold + 0 (list 1 2 3)) 22:55 rudybot: Senjai: ; Value: 6 22:55 Senjai: See Lajla ? That's what it's supposed to do 22:55 Lajla: No, I don't understand it, sorry. 22:56 Senjai: Based on what you pass to red, it can behave like fold, or like natfun. 22:56 Senjai: you choose how it tests the base, what the base is, how to get to the next value, and the function. 22:57 Senjai: then it just runs it 22:57 Lajla: Ehhh 22:58 Lajla: So wait 22:58 Lajla: no, I still don't get it. 22:58 Lajla: Just specify what red does. 22:59 (nick) Lajla -> Geisteskrankh 23:00 Senjai: anything 23:00 Senjai: uhh 23:00 Senjai: Ill finish coding it then ill show you 23:02 Senjai: rudybot, (natfun + 0 6) 23:02 rudybot: Senjai: ; Value: 21 23:11 (join) shachaf 23:27 (join) mithos28 23:51 Senjai: Geisteskrankh: you still here 23:51 Senjai: Geisteskrankh: I finished the problem set, you wanna see it? 23:53 Senjai: Geisteskrankh: gonna head home from my uni, Ill post the code if you wanna see it 23:54 Senjai: Geisteskrankh: http://codepad.org/NNC0hD4n 23:54 Senjai: tty soon when I get home