00:10 (quit) tauntaun: Quit: Ex-Chat 00:44 (quit) poindontcare: Read error: Connection reset by peer 01:02 (join) jeapostrophe 01:28 (quit) jeapostrophe: Quit: jeapostrophe 01:29 (quit) bugQ: Remote host closed the connection 01:36 (quit) realitygrill: Ping timeout: 246 seconds 01:47 (join) Lajla 01:47 (part) Lajla 01:54 (join) RpR` 03:28 (quit) jonrafkind: Ping timeout: 240 seconds 04:32 (join) MayDaniel 05:01 (join) masm 05:17 (part) RpR`: "ERC Version 5.3 (IRC client for Emacs)" 07:42 (join) ghiu 07:43 ghiu: hi, how can i cycle a list with an enumerator? like, while looping it, knowing that the current item is the first, or the second... 07:43 ghiu: i can build a function to do this, but i'd like to know if there is something in the standard library 07:43 ghiu: thanks 07:54 (quit) ghiu: Quit: ghiu 07:54 (join) ghiu 08:01 rapacity: rudybot: (for/list ([i '(a b c)] [n (in-naturals)]) (cons n i)) 08:01 rudybot: rapacity: your sandbox is ready 08:01 rudybot: rapacity: ; Value: ((0 . a) (1 . b) (2 . c)) 08:02 ghiu: thank you very much :) 08:02 (join) lucian 08:50 tonyg: eli: re pruning collects: I forgot to mention that the rootfs is compressed, meaning that quite a bit more than 16MB can be squeezed in. mzlib+syntax+racket = ~15MB uncompressed, but compress down to ~4MB... it Might Just Work :-) 08:51 tonyg: so is it known what the kernel subset of collects is? if not, I guess I should take mzlib+syntax+racket as an initial guess. 08:57 (join) jeapostrophe 09:30 (quit) jeapostrophe: Quit: jeapostrophe 09:42 (quit) ghiu: Quit: ghiu 09:44 (join) jeapostrophe 09:48 (quit) jeapostrophe: Client Quit 09:54 em: when you have some data and you want to put it into a list so you can start working on it, is there a canonical way to read the data and turn it into a list? 09:54 em: Is the 'best' way to just read one character at a time and include stuff you like and not include stuff you dont, cons-ing all the way? 09:55 (join) tauntaun 09:57 ohwow: hm, (read)? 09:57 ohwow: http://docs.racket-lang.org/reference/Reading.html?q=read#%28def._%28%28quote._~23~25kernel%29._read%29%29 09:57 rudybot: http://tinyurl.com/4xagodj 09:58 (join) ghiu 10:07 (join) rPR` 10:14 (quit) ghiu: Quit: ghiu 10:28 (join) jeapostrophe 10:36 (join) anRch 10:43 (quit) MayDaniel: 10:49 (join) bugQ 10:53 (join) mceier 10:53 (quit) jeapostrophe: Quit: jeapostrophe 11:06 (quit) rPR`: Remote host closed the connection 11:17 em: ohwow: weird. i had a bunch of data separated like this , [ 3.33 , 112 ] , [ 3.35 , 1.02 ] , etc.. 11:18 em: ohwow: by using (read) it changed the [ and ] into '( 3.35 ,1.02) 11:18 em: i wonder how it could know that. 11:18 ohwow: well Racket read can understand [ and ] 11:18 ohwow: [] and () are equivalent 11:18 ohwow: you can change the reader to accept your syntax IIRC 11:18 em: it 'knew' that the [ ] were tupples somehow. 11:35 (quit) bugQ: Ping timeout: 260 seconds 11:41 (join) MayDaniel 11:41 (join) PLT_Notify 11:41 PLT_Notify: racket: master Matthew Flatt * 5dfd17d (4 files in 2 dirs): linux: use /proc/self/maps to find precise stack base - http://bit.ly/ivEi4X 11:41 (part) PLT_Notify 11:44 (quit) anRch: Quit: anRch 11:51 (join) jonrafkind 12:31 (join) ghiu 12:38 em: Is there maby a library for reading JSON encoded data? 12:44 ohwow: http://planet.racket-lang.org/display.ss?package=json-parsing.plt&owner=neil ? 12:44 rudybot: http://tinyurl.com/3g7mdv6 12:46 (quit) ghiu: Quit: ghiu 12:52 (join) ZachBeta 12:53 (join) ghiu 12:56 (quit) ghiu: Client Quit 13:02 (join) ghiu 13:03 (join) lucian_ 13:05 (quit) ghiu: Client Quit 13:05 (quit) lucian: Ping timeout: 244 seconds 13:09 (join) ghiu 13:09 (join) lucian 13:10 (quit) lucian_: Ping timeout: 260 seconds 13:24 (join) jeapostrophe 13:24 (join) dnolen 13:31 (join) bugQ 13:34 (quit) ghiu: Quit: ghiu 13:37 (quit) jeapostrophe: Quit: jeapostrophe 14:05 (join) petey-aw` 14:06 (join) mario-go` 14:06 (quit) mario-goulart: *.net *.split 14:06 (quit) RandalSchwartz: *.net *.split 14:06 (quit) petey-away: *.net *.split 14:06 (quit) rudybot: *.net *.split 14:08 (join) rudybot 14:10 (join) Sgeo_ 14:11 (quit) Sgeo: Ping timeout: 250 seconds 14:58 (join) ghiu 15:00 (join) marchdown 15:05 (quit) marchdown: Ping timeout: 255 seconds 15:21 offby1: em: I think so, on PLaneT 15:23 ghiu: is there something in the standard library to express "map this list with this function n times"? 15:33 offby1: dunno 15:33 offby1: what does that mean? Can you paste a tiny illustrative example? 15:34 ghiu: i mean feeding a map function with result of a map function with the result of a map function... 15:35 jonrafkind: (map (lambda (n) (for/fold ([n n] [i (in-range 5)]) (f n)) stuff) 15:35 ghiu: it can be done recursively 15:35 jonrafkind: something like that I suppose? 15:35 ghiu: i just wanted to know if there is some function to do it 15:36 offby1: this might be inspirational: 15:36 offby1: rudybot: wou 15:36 rudybot: *offby1: error: reference to an identifier before its definition: wou in module: 'program 15:36 offby1: heh 15:36 offby1: rudybot: (map add1 (map add1 (map add1 (build-list 10 values)))) 15:36 rudybot: *offby1: ; Value: (3 4 5 6 7 8 9 10 11 12) 15:37 offby1: rudybot: (map (compose add1 add1 add1) (build-list 10 values)) 15:37 rudybot: *offby1: ; Value: (3 4 5 6 7 8 9 10 11 12) 15:39 offby1: rudybot: (define multi-compose (lambda (func n) (let loop ([result values] [n n]) (if (zero? n) result (loop (compose func result) (sub1 n)))))) 15:39 rudybot: *offby1: Done. 15:39 offby1: rudybot: (map (multi-compose add1 3) (build-list 10 values)) 15:39 rudybot: *offby1: ; Value: (3 4 5 6 7 8 9 10 11 12) 15:39 offby1: ta da 15:39 ghiu: wow 15:40 offby1: I'd be a little surprised if there weren't already something like multi-compose in the standard library. 15:40 ghiu: i may need some time to get it 15:40 ghiu: ah ah 15:40 ghiu: i'm trying to learn a bit more about racket using rosettacode.org 15:40 offby1: rudybot: (define (sqr x) (* x x)) 15:40 rudybot: *offby1: Done. 15:40 offby1: rudybot: (map (multi-compose sqr 3) (build-list 10 values)) 15:40 rudybot: *offby1: ; Value: (0 1 256 6561 65536 390625 1679616 5764801 16777216 43046721) 15:41 ghiu: i'm trying to get a nice solution for http://rosettacode.org/wiki/100_doors 15:41 ghiu: basically, it's multi-compose + map-step 15:41 offby1: interesting looking site 15:41 ghiu: i've defined map-step like this 15:41 ghiu: (define (map-step proc step lst) 15:41 ghiu: (for/list ((i lst) (n (in-naturals 1))) 15:41 ghiu: (if (equal? (modulo n step) 0) 15:41 ghiu: (proc i) 15:41 ghiu: i))) 15:42 offby1: for 100 doors, my hunch is that the result is that all the prime-numbered doors are opened 15:42 offby1: I'd actually solve that particular problem using mutation :) 15:42 offby1: vector of 100 booleans. 15:42 ghiu: rudybot: (define (map-step proc step lst) (for/list ((i lst) (n (in-naturals 1))) (if (equal? (modulo n step) 0) (proc i) i))) 15:42 rudybot: ghiu: your sandbox is ready 15:42 rudybot: ghiu: Done. 15:43 offby1: ghiu: do you know about in-indexed? 15:43 ghiu: nope 15:43 ghiu: reading about it 15:44 offby1: it should let you write (for/list ([(i n) (in-indexed lst)])) 15:44 offby1: ... although that counts from zero, and you seem to be counting from one. 15:45 offby1: anyway, even if it isn't exactly the right thing here, it's handy to know. 15:45 ghiu: oh, yes 15:45 ghiu: it is indeed 15:45 ghiu: i've been looking for it 15:45 ghiu: but yes, i need to count from 1 15:47 ohwow: [21:41] < offby1> for 100 doors, my hunch is that the result is that all the prime-numbered doors are opened 15:47 (quit) Sgeo_: Ping timeout: 240 seconds 15:47 ohwow: yeah i think that's the answer 15:47 ohwow: actually 15:47 ohwow: no 15:47 ohwow: nevermind 15:48 ghiu: it may be the optimized solution 15:48 ghiu: but i'd like to come up for the non optimized solution 15:48 ghiu: it's more interesting from a learning pov 15:53 offby1: yep 15:57 offby1: not functional, but pretty simple: http://ix.io/1I6 15:58 ghiu: yeah, i've come up with a similar solution already 15:58 ghiu: but it's a mution of a c-like approach 15:59 ghiu: i'm taking my time and try to find a more functional approach 15:59 ghiu: without mutable elements :) 16:01 offby1: less cruft: http://ix.io/1I7 16:24 ghiu: offby1 16:26 ghiu: can you review this? http://pastie.org/1990240 16:26 ghiu: not very polished, but it's more or less what i was after 16:26 ghiu: and it works 16:27 ghiu: i'd like you to review it before submitting it to rosettacode 16:35 (quit) bugQ: Ping timeout: 250 seconds 16:42 (quit) ghiu: Quit: ghiu 16:49 (join) Demosthenes 16:58 (join) ghiu 17:08 offby1: heh 17:08 offby1: ok 17:08 offby1: if "review" means "nit-pick", I'm your man. 17:12 offby1: ghiu: I made two _tiny_ changes: http://pastie.org/1990402 17:16 ghiu: thanks! 17:16 ghiu: as for the first change 17:17 ghiu: i've already changed it using in-indexed as you suggested 17:17 ghiu: i used it a bit differently though 17:18 ghiu: (for/list (((i n) (in-indexed lst))) 17:19 ghiu: if you check the current version on rosettacode 17:19 ghiu: :) 17:25 (quit) lucian: Remote host closed the connection 17:28 ghiu: i've added the optimized version as well 17:43 offby1: ghiu: now I've stolen your ideas and incorporated them into mine: http://ix.io/1I9 17:44 ghiu: oh, it's a more polished solution 17:44 ghiu: it's more elegant than mine 17:45 ghiu: change it into rosettacode! 17:45 offby1: if you want 17:45 ghiu: sure 17:47 offby1: done 17:48 offby1: the thing that nags me is that my "map-index" isn't _really_ like "map", since "map" takes any number of sequences, but "map-index" only takes one. 17:49 (join) jeapostrophe 17:49 ghiu: right 17:49 ghiu: but it works for this particular case 17:49 ghiu: maybe it's just the name that's not 100% correct 17:49 offby1: yeah 17:50 offby1: also note that where it says (solve (make-vector 100 #f)) you could just as easily put (solve (build-list 100 (lambda (_) #f))), without changing anything else, and it'd still work. 17:51 offby1: in other words, "solve" doesn't care if it gets a list or a vector; all it cares is that it gets a sequence. You might even be able to give it a channel, e.g. 17:52 (quit) jeapostrophe: Client Quit 17:54 ghiu: oh 17:54 ghiu: thanks 17:54 ghiu: i guess i'll learn a lot just hanging around here 17:59 (join) jeapostrophe 17:59 (quit) jeapostrophe: Client Quit 18:00 (join) JoelMcCracken 18:02 (join) samth 18:06 (quit) ghiu: Quit: ghiu 18:09 offby1: naw 18:09 offby1: it's a lie 18:09 (join) ghiu 18:09 offby1: in fact, hanging out here actually makes you dumber 18:11 samth: offby1, spreading such nasty rumors 18:13 (join) thefreak47 18:14 (quit) MayDaniel: Read error: Connection reset by peer 18:14 (quit) thefreak47: Client Quit 18:17 em: Im here! 18:17 em: where shall we cue?! 18:17 em: oh crap, sorry wrong channel :( 18:22 (quit) ghiu: Quit: ghiu 18:25 (topic) samth: Racket -- http://racket-lang.org -- Come to RacketCon: July 23-24 -- logs @ http://racket-lang.org/irc-logs 18:26 (topic) samth: Racket -- http://www.twit.tv/floss167 -- http://racket-lang.org -- Come to RacketCon: July 23-24 -- logs @ http://racket-lang.org/irc-logs 18:28 (quit) dnolen: Quit: dnolen 18:30 (join) jao 18:31 (quit) mceier: Quit: leaving 19:08 (join) lucian_ 19:45 (join) jeapostrophe 19:46 (quit) jeapostrophe: Client Quit 19:53 (nick) lucian_ -> lucian 21:04 (quit) masm: Ping timeout: 250 seconds 21:53 (quit) lucian: Quit: Ex-Chat 22:08 (quit) tauntaun: Quit: Ex-Chat 22:24 (quit) JoelMcCracken: Remote host closed the connection 22:31 (join) ckrailo 22:48 (quit) samth: Ping timeout: 255 seconds 22:58 (join) JoelMcCracken 23:20 (join) realitygrill 23:48 (topic) eli: Racket -- http://racket-lang.org/ -- http://twit.tv/floss167/ -- Come to RacketCon: July 23-24 -- logs @ http://racket-lang.org/irc-logs/ 23:48 eli: samth_: slashes. 23:52 jonrafkind: maybe you could add a description to the twit.tv link