00:07 (join) acarrico 00:08 brum: (define honestwork #f) 00:10 jonrafkind: how dare you ask for help, you should be ashamed of yourself 00:12 (quit) Slavisa: Ping timeout: 246 seconds 00:15 (quit) brum: Remote host closed the connection 00:16 (join) mizu_no_oto 00:26 (join) Nisstyre-laptop 00:31 (quit) yacks: Ping timeout: 276 seconds 00:42 (join) yacks 00:51 (quit) mizu_no_oto: Quit: Computer has gone to sleep. 00:51 (join) mizu_no_oto 00:52 (join) jao 00:52 (quit) jao: Changing host 00:52 (join) jao 01:00 (quit) mizu_no_oto: Quit: Computer has gone to sleep. 01:14 (join) Kaylin 01:22 (quit) mceier: Quit: leaving 01:55 (quit) jao: Ping timeout: 264 seconds 02:07 vipjun: yes i should keep shoving the square peg into the round hole until it finally goes in. 02:08 (quit) stamourv: Ping timeout: 255 seconds 02:12 (join) ambrosebs 02:14 (quit) jonrafkind: Ping timeout: 255 seconds 02:38 (quit) ambrosebs: Remote host closed the connection 02:41 (join) mceier 02:46 (join) hkBst 02:46 (quit) hkBst: Changing host 02:46 (join) hkBst 03:00 (join) ambrosebs 03:01 (quit) ambrosebs: Remote host closed the connection 03:03 (quit) gridaphobe: Remote host closed the connection 03:04 (join) ambrosebs 03:05 (quit) ambrosebs: Remote host closed the connection 03:07 (quit) bjz: Read error: Connection reset by peer 03:07 (join) bjz 03:11 (quit) vipjun: 03:16 (quit) bjz: Read error: Connection reset by peer 03:16 (join) bjz 03:17 (quit) hkBst: Remote host closed the connection 03:17 (join) hkBst 03:20 (join) leo2007 03:32 (join) rmathews_ 03:32 (quit) rmathews: Ping timeout: 255 seconds 03:32 (nick) rmathews_ -> rmathews 03:32 (quit) Nisstyre-laptop: Quit: Leaving 03:45 (join) ambrosebs 03:50 (join) rohni 03:58 (quit) mithos28: Quit: mithos28 04:03 (quit) ambrosebs: Remote host closed the connection 04:05 (join) jao 04:05 (quit) jao: Changing host 04:05 (join) jao 04:05 (join) ambrosebs 04:09 (quit) hkBst: Read error: Connection reset by peer 04:13 (quit) ambrosebs: Remote host closed the connection 04:17 (join) hkBst 04:27 (quit) dauterive: Quit: Leaving 04:28 (join) bitonic 04:35 (join) didi` 04:36 (quit) cdidd: Ping timeout: 255 seconds 04:36 (nick) didi` -> didi 04:37 (join) ambrosebs 04:45 (quit) ambrosebs: Remote host closed the connection 04:47 (join) ambrosebs 04:52 (join) cdidd 05:02 (quit) hkBst: Ping timeout: 244 seconds 05:06 (join) Slavisa 05:14 (join) hkBst 05:14 (quit) hkBst: Changing host 05:14 (join) hkBst 05:18 (join) anonymou1 05:19 anonymou1: Hello everyone! 05:19 (quit) leo2007: Ping timeout: 246 seconds 05:19 anonymou1: I am reading Chapter 4.13: Dynamic Binding, parameterize 05:20 anonymou1: The parameterize form is not a binding form like let; each use of location above refers directly to the original definition. A parameterize form adjusts the value of a parameter during the whole time that the parameterize body is evaluated, even for uses of the parameter that are textually outside of the parameterize body: 05:20 anonymou1: Please tell me clearly 05:22 anonymou1: Is there difference (except as in just the text) in: (let ([a (make-parameter "b")]) BLA-BLA-BLA) and (parameterize ([a "b"]) BLA-BLA-BLA) and what is the difference 05:22 anonymou1: ? 05:24 anonymou1: ah, deep night in US... 05:24 (quit) jao: Ping timeout: 256 seconds 05:24 anonymou1: :( 05:25 anonymou1: how can I see the difference& 05:25 anonymou1: ?* 05:56 (join) tilde` 05:58 (join) martinux 06:03 (join) noelw 06:12 (quit) bitonic: Remote host closed the connection 06:12 (join) bitonic 06:33 (quit) anonymou1: Quit: leaving 06:33 (quit) Slavisa: Ping timeout: 276 seconds 06:49 (quit) cored: Ping timeout: 260 seconds 06:51 (join) cored 06:55 (join) tilde`_ 06:58 (quit) tilde`: Ping timeout: 260 seconds 07:01 (quit) tilde`_: Quit: kthxbai 07:16 (join) netrino 07:17 (join) jeapostrophe 07:17 (quit) jeapostrophe: Changing host 07:17 (join) jeapostrophe 07:22 (quit) Kaylin: Read error: Connection reset by peer 07:49 (join) Slavisa 08:06 (join) Aune 08:09 (quit) martinux: Read error: Connection reset by peer 08:09 (join) Fare 08:09 (join) martinux 08:15 (join) rmathews 08:26 (quit) martinux: Read error: Connection reset by peer 08:26 (join) martinux 08:41 (quit) Slavisa: Ping timeout: 255 seconds 08:41 (quit) acarrico: Ping timeout: 245 seconds 08:54 (join) Slavisa 08:58 (join) acarrico 08:59 (quit) hkBst: Read error: Connection reset by peer 08:59 (join) hkBst 09:05 (quit) rohni: Quit: Leaving. 09:09 (quit) hkBst: Remote host closed the connection 09:10 (join) hkBst 09:10 (quit) hkBst: Changing host 09:10 (join) hkBst 09:12 martinux: hey. Can i make a mutable vector of size n in racket? Preferably all items in the vector should be #f initially 09:13 didi: rudybot: (make-vector 10 #f) 09:13 rudybot: didi: your sandbox is ready 09:13 rudybot: didi: ; Value: #(#f #f #f #f #f #f #f #f #f #f) 09:13 didi: martinux: ^ 09:18 (join) anRch 09:19 martinux: didi: thanks a bunch 09:30 (join) mizu_no_oto 09:44 (join) stamourv 09:44 (quit) stamourv: Changing host 09:44 (join) stamourv 09:47 (quit) ambrosebs: Remote host closed the connection 09:48 (join) ambrosebs 09:53 (join) rohni 10:11 (quit) ambrosebs: Remote host closed the connection 10:28 (join) adu 10:29 (join) ambrosebs 10:30 (quit) adu: Read error: No route to host 10:31 (join) adu 10:33 (quit) hkBst: Ping timeout: 256 seconds 10:34 (join) hkBst 10:34 (quit) hkBst: Changing host 10:34 (join) hkBst 10:37 (quit) xulfer: Quit: quitting 10:43 (quit) martinux: Read error: Connection reset by peer 10:43 (join) martinux 10:45 (join) hash_table 10:46 (quit) rohni: Quit: Leaving. 10:46 (quit) cdidd: Remote host closed the connection 10:47 (join) gridaphobe 10:49 (quit) anRch: Quit: anRch 10:49 (quit) jeapostrophe: Ping timeout: 256 seconds 10:51 (quit) ambrosebs: Remote host closed the connection 11:01 (join) rohni 11:01 (join) racycle 11:01 (quit) mceier: Quit: leaving 11:03 didi: If I'm creating a new exception structure to a library and I'm using `exn:fail' struct as its super, should I name it `exn:fail:my-exception' or just `my-exception'? 11:05 (join) mithos28 11:06 asumu: didi: I'd go with `exn:fail:my-exception` 11:08 didi: asumu: Yeah, that's what I'm thinking too. Although I'm a little concern about symbol clashing. Maybe prefixing `my-exception' with the library's name, but that might be too much. 11:09 asumu: If this is in a library, your library's client can just (require (prefix-in ...)) 11:10 adu: is this possible? http://paste.lisp.org/display/135609 11:10 didi: asumu: Thanks. 11:10 asumu: adu: no, I don't think so. Why not just have (assign op a b)? 11:11 didi: adu: Looks like you want `setf'. 11:11 adu: oh, I guess that would make more sense 11:16 (quit) adu: Read error: Connection reset by peer 11:16 (join) adu 11:16 adu: thanks 11:26 (quit) hkBst: Quit: Konversation terminated! 11:26 (quit) rohni: Quit: Leaving. 11:28 (quit) Aune: Quit: Hath Deprated 11:30 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"] 11:31 (quit) martinux: Quit: Lost terminal 11:41 asumu: Seen on twitter: http://jvjulien.free.fr/Informatique/Racket/racket.htm#distance-ville 11:48 (join) rich2 11:49 (join) DaniG2k 11:49 (join) Kaylin 11:49 DaniG2k: guys Im trying to do something super simple in racket but 11:49 DaniG2k: its the first time i use it and cannot understand the syntax too well 11:50 asumu: DaniG2k: ask away. 11:50 Cryovat: asumu: That's wonderfully concise :D 11:50 asumu: Cryovat: :D 11:50 DaniG2k: i want to make a loop from x to y with a step z 11:50 rich2: DaniG2k: range(x y z) 11:50 DaniG2k: should i use cond for this or just if? 11:51 mithos28: DaniG2k: (in-range 0 10 2) 11:51 asumu: rudybot: (for/list ([i (in-range 1 10 2)]) i) 11:51 rudybot: asumu: your sandbox is ready 11:51 rudybot: asumu: ; Value: (1 3 5 7 9) 11:51 rich2: e.g. (map my-special-func (range 0 10 1)) 11:51 asumu: DaniG2k: ^ for example 11:52 DaniG2k: hm what if I want to use recursion here? that's what i was trying to do 11:52 DaniG2k: range is probably better but 11:52 rich2: asumu: i'm a beginner too, is there a preference when to use for/list compared to map? 11:52 DaniG2k: i just want to get a feel for making the function 11:52 didi: DaniG2k: Use `if'. 11:52 rich2: i guess for/list is when you don't care about the result as map builds the result list 11:52 (quit) Slavisa: Read error: Connection reset by peer 11:52 mithos28: rich2: If you are going to write an anonymous function, then for/list is usually easier to read 11:53 mithos28: rich2: for/list builds a list, for does not 11:53 asumu: rich2: for/list is more general, since you can traverse more than just a list or several lists. 11:53 (join) anonymous97890 11:55 Cryovat: Plain for feels a bit un-FP 11:55 asumu: DaniG2k: if you know how to write a `map` or `for-each` function using recursion, then this problem reduces to writing a function that builds a list of numbers in the range you want. 11:55 mithos28: Cryovat: That may be because its only use is effects 11:56 Cryovat: Yeah, my Lisp teacher instilled a deep fear of anything that might look imperative in me :D 11:57 didi: Cryovat: They might hate CL's `LOOP' then. 11:57 asumu: Sometimes you just need to print stuff. 11:58 anonymous97890: Hello everyone! 11:58 asumu: Hi. 11:58 anonymous97890: I am installing 5.3.3 11:58 anonymous97890: If you want to install new system links within the "bin" and "man" subdirectories of a common directory prefix (for example, "/usr/local") then enter the prefix of an existing directory that you want to use. This might overwrite existing symlinks, but not files. 11:58 anonymous97890: (default: skip links) > /usr/local/bin 11:58 anonymous97890: "/usr/local/bin/bin" does not exist, skipping. 11:58 anonymous97890: "/usr/local/bin/share/man/man1" does not exist, skipping. 11:58 anonymous97890: Installation complete. 11:58 anonymous97890: not great! It was a typo 11:58 anonymous97890: That's not critical for me, but it could be better 11:59 anonymous97890: Is anyone agreed/disagreed here? 11:59 rich2: is there a generic function similar to 'for/list' but uses a "window". e.g. (windowed-loop F '(1 2 3 4)) would produce F(X, 1), F(1 2), F(2 3), F(3 4), F(4 X) 11:59 asumu: Is the problem that the install script didn't detect that "/usr/local/bin" was a typo? 11:59 rich2: i need a variant with window size 2 and 3 12:00 rich2: i'm trying to write it myself - but at least rackunit and check is good :) 12:00 anonymous97890: asumu: I think he should suggest me to correct or ask if I sure. 12:00 anonymous97890: am* 12:01 anonymous97890: Please tell me if you disagree. 12:01 asumu: I don't think the install script can be smart enough to figure out if you typoed or not. 12:01 anonymous97890: with* 12:02 (join) jeapostrophe 12:02 (quit) jeapostrophe: Changing host 12:02 (join) jeapostrophe 12:03 anonymous97890: asumu: he skipped. He didn't do thing I asked him to do. He has some (better than nothing) idea - to not do anything, but that's strange since I've told him to. 12:04 rich2: i thought i could use foldl for the 2 wide window - but foldl uses the result from the previous call rather than the next element 12:04 anonymous97890: Ok, doesn't matter. Thank you for your opinion, that's not critical for me, just a little suggestion, I expected it can be good. 12:04 anonymous97890: could* 12:05 (quit) noelw: Quit: noelw 12:05 DaniG2k: guys 12:06 (quit) gridaphobe: Remote host closed the connection 12:06 anonymous97890: ? 12:07 (join) mceier 12:09 (quit) anonymous97890: Quit: Lost terminal 12:10 asumu: rich2: maybe iterate through the list and use `(take lst 2)` at each step? Stop when the list has fewer than 2 elements (and handle the first and last elements specially). 12:10 asumu couldn't think of a more elegant way off the top of his head 12:11 rich2: asumu: good idea, i'll try that. my way of (rest (rest x)) was failing at the end and i couldn't think of how to get round it 12:12 rich2: sorry (first (rest x)) 12:14 (join) mizu_no_oto 12:16 (quit) DaniG2k: Read error: Operation timed out 12:16 (join) anonymous97890 12:17 (quit) acarrico: Ping timeout: 248 seconds 12:17 (join) jbclements 12:19 (join) dnolen 12:28 (join) gridaphobe 12:32 (join) jonrafkind 12:32 (quit) jonrafkind: Changing host 12:32 (join) jonrafkind 12:33 anonymous97890: I have just tried to use "#lang slideshow". I wrote (circle 10) and executed. It worked. I closed DrRacket without saving. Then I done the same, but I saved the code. After I closed DrRacket(both times), and runned it again - I #lang racket was runned. 12:33 (join) acarrico 12:33 anonymous97890: s/I / 12:33 anonymous97890: The Guide says: If you’ve used DrRacket before with something other than a program that starts #lang, DrRacket will remember the last language that you used, instead of inferring the language from the #lang line. 12:34 anonymous97890: here: http://docs.racket-lang.org/guide/intro.html 12:34 anonymous97890: Should I send a bugreport? 12:34 bremner: there are some settings about that. 12:34 bremner: check the detailed language settings. 12:35 mithos28: #lang slideshow is not a language in the sense that that sentence is using the word 12:35 anonymous97890: mithos28: I tried #lang scribble/base before it - the same effect 12:35 anonymous97890: bremner: did the Guide lie to me? 12:35 (join) ijp 12:35 anonymous97890: if it lies, should I send a bugreport? 12:35 mithos28: that when you reopen drracket it opens with #lang racket 12:36 mithos28: like I said, the individual #lang lines are not languages in the sense that that sentence is using the word 12:36 anonymous97890: mithos28: I've tried scribble/base and slideshow. Give me, please an example of a language they meant 12:36 (join) anRch 12:36 asumu: anonymous97890: notice that that sentence says "other than a program that starts #lang". 12:36 mithos28: pretty big, htdp 12:37 asumu: i.e., if you are using #lang, this does not apply (since DrRacket infers the language from source). 12:38 jbclements: to be (slightly) more precise: if you are using #lang and DrRacket is set to "Use language declared in program…". Right? 12:38 asumu: (yes, what jbclements said) 12:39 (join) RacketCommitBot 12:39 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/2bus2A 12:39 RacketCommitBot: racket/master 200c209 Matthias Felleisen: make read-csv-file/rows available in BSL; closes PR 13542 12:39 (part) RacketCommitBot 12:40 anonymous97890: ah, yes! Thank you. 12:40 (quit) gridaphobe: Remote host closed the connection 12:40 anonymous97890: very much 12:40 bremner: right, that's what I meant about detailing language settings 12:43 (join) noelw 12:44 (quit) mithos28: Quit: mithos28 12:50 (quit) anonymous97890: Quit: leaving 12:50 (join) anonymous97890 12:58 (quit) adu: Quit: adu 13:00 (join) dyoo 13:01 (quit) anonymous97890: Quit: Lost terminal 13:06 (quit) netrino: Ping timeout: 255 seconds 13:08 (join) didi 13:11 (quit) dyoo: Read error: Connection reset by peer 13:11 (join) dyoo_ 13:11 (join) gridaphobe 13:13 (join) ryan_c 13:14 (quit) yacks: Quit: Leaving 13:18 (quit) noelw: Quit: noelw 13:20 (quit) jonrafkind: Ping timeout: 264 seconds 13:24 (quit) jeapostrophe: Ping timeout: 244 seconds 13:31 (quit) anRch: Quit: anRch 13:47 rich2: i think i've done it and although my basic tests pass, i'm still not confident 13:48 rich2: i've called it windowed-map except the function takes 2 (previous and current) arguments instead of 1 (current) 13:49 didi: rich2: I coded one too if you want to take a look. :^) 13:49 rich2: didi: ooh i'd like to, i'll paste mine somewhere - any criticism or pointers of mine would be helpful 13:51 didi: rich2: http://paste.kde.org/678614/ 13:57 rich2: http://paste.opensuse.org/69718557 13:59 (join) netrino 14:00 (join) jeapostrophe 14:01 rich2: didi: is the n parameter meant to be fixed at 2? it errors if i use 3 14:01 didi: rich2: Really? It shouldn't. :^( 14:01 didi: (map-window list 42 3 (list 1 2 3 4)) => '((42 1 2) (1 2 3) (2 3 4) (3 4 42)) 14:02 rich2: ah correct, it was cons in mine 14:02 didi: :^) 14:02 (quit) netrino: Remote host closed the connection 14:02 didi: (map-window + 42 3 (list 1 2 3 4)) => '(45 6 9 49) 14:03 stamourv: rudybot: (define l '(1 2 3 4)) 14:03 rudybot: stamourv: your sandbox is ready 14:03 rudybot: stamourv: Done. 14:04 stamourv: rudybot: (for/list ([x l] [y (rest l)]) (cons x y)) 14:04 rudybot: stamourv: ; Value: ((1 . 2) (2 . 3) (3 . 4)) 14:04 stamourv: rich2: ^ 14:04 stamourv: Pad the list if you want `(X . 1)' and `(4 . X)'. 14:05 rich2: stamourv: tidy solution - i think i need to learn for/list 14:06 rich2: could for/list work for a window of 3 14:06 stamourv: rich2: Sure. 14:06 stamourv: rudybot: (for/list ([x l] [y (rest l)] [z (rest (rest l))]) (list x y z)) 14:06 rudybot: stamourv: ; Value: ((1 2 3) (2 3 4)) 14:07 stamourv: asumu: Re distance-ville: This is pretty awesome. 14:07 (join) RacketCommitBot 14:07 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/4KR0Ow 14:07 RacketCommitBot: racket/master 7558eb4 Danny Yoo: Conditionally link to the SRFI docs on docs.racket-lang.org when rendering PDFs.... 14:07 (part) RacketCommitBot 14:07 rich2: that's what i missing earlier, when i was using (first (rest x)) and (rest (rest x)) it was erroring (correctly) due to them being empty 14:11 samth: stamourv: can you translate it for us? 14:12 stamourv: samth: Sure, what do you want to know? 14:12 stamourv: The first example computes the distance between 2 cities. 14:12 samth: stamourv; not sure, just a summary 14:12 dented42: when using define-relation in redex, what's the difference between ⊂ and ⊆ in the contract? 14:13 stamourv: samth: The second displays a graph of the water level of a given french river. 14:13 stamourv: The third shows a live count of the twitter followers an account has. 14:13 didi: rich2: http://paste.kde.org/678662/ 14:13 stamourv: The fourth is a live graph of wind speed. 14:14 stamourv: And the last is a barometer. 14:14 didi: rich2: Nah, it's wrong. 14:14 didi: rich2: Sorry. 14:14 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"] 14:14 (quit) Kaylin: Quit: Leaving. 14:15 samth: stamourv: pretty cool 14:15 samth: thanks 14:17 stamourv: It's especially cool that each of these is only about a dozen lines. 14:17 stamourv: Racket is pretty awesome. 14:19 (quit) ryan_c: Quit: Ex-Chat 14:21 asumu: dented42: I suspect there is no difference, but this is just a conjecture. 14:21 dented42: ok 14:22 dented42: I'm looking over the source, and there doesn't seem to be one. 14:25 (quit) gridaphobe: Remote host closed the connection 14:25 rich2: i'm struggling a bit with for/list - i think for/list (for 2 lists anyway) "zips" the 2 together, so the 1st element of both are picked, then the 2nd of both, and this happens min(length(list1), length(list2)) times 14:26 rich2: i;m confused with stamourv: answer above (for/list ([x l] [y (rest l)]) (cons x y)) 14:26 rich2: because y will "run out" of elements before x 14:29 rich2: ah think i got it now 14:30 dyoo_: rich2: yeah, the the for loops do parallel iteration. The for* loops do nested iteration 14:30 rich2: he's "moving y down" compared to x, then "zipping" 14:31 rich2: so for*/list would be a cartesian product 14:32 (quit) dnolen: Ping timeout: 248 seconds 14:34 paddymahoney: question-what do you all do while recompiling racket? 14:35 dyoo_: paddymahoney: I usually keep two copies of racket around, so I can continue working. :) 14:36 (quit) dyoo_: Quit: dyoo_ 14:36 paddymahoney: great answer! I need a second anyways to do scripting on the first :) 14:36 rich2: i was actually going to search for how to do a cartesian product in the general sense and for*/list does it :) 14:39 rich2: other languages don't really have an excuse for not having features do they, because if they made their languages rewrite/transform into racket they'd get them 14:39 rich2: e.g. var x = y; print(x); -> (let ([x y)) (print x)) 14:42 (join) dyoo 14:42 rich2: i wonder how bad it would be if some languages targeted a lower level language but still high level rather than basically assembly language/CIL etc 14:43 dyoo: rich2: I've been actually thinking about what it would take to do an llvm backend for racket. 14:45 rich2: dyoo: i guess a lot, no? would racket gain anything in terms of extra analysis or performance before hitting the CPU? 14:46 (join) keppy 14:46 dyoo: Perhaps. But it would also mean I get to obsolete Whalesong, since there's an llvm->js thing out there called Emscripten. :) 14:47 dyoo: (or, at the very least, retarget Whalesong so it emits llvm code instead of the crazy-silly intermediate language it's generating now.) 14:48 rich2: nice, theres a lua interpreter based from emscripten 14:49 dyoo: so yeah, I've started to look at Eric's work with llvm bindings in https://github.com/shekari/racket-llvm 14:49 rich2: *penny drop - we could get racket in the browser? 14:50 rich2: great work dyoo: 14:50 dyoo: Would like that. Currently doing http://wescheme.org with that goal in mind. 14:50 paddymahoney: that would be quite cool. 14:52 rich2: although with everything rewriting to javascript - what does javascript rewrite into? it's missing several features i like from racket at least - bignums for 1 14:53 rich2: do browsers still lock everything when javascript executes ? 14:53 dyoo: rich2: https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers 14:54 dyoo: not necessarily anymore. And you can still play some tricks to avoid blocking the browser even in a single-threaded world by trampolining. 14:55 rich2: thanks 14:55 dyoo: example: 14:56 dyoo: http://www.wescheme.org/openEditor?publicId=GLQfrukW1L 14:56 dyoo: Press "Run", and you should see cpu usage go high 14:56 dyoo: but you can still press break to interrupt the computation. 14:56 dyoo: (I mean, you can press "Stop") 14:57 rich2: so is that wescheme or the browser allowing the Stop? 14:58 dyoo: wescheme is periodically abandoning the current computation, saving it in a callback, and then giving control back to the browser. 14:58 rich2: ah 14:58 dyoo: the browser then restarts the trampoline at some point. Between that period, you can interact with gui elements, so the browser doesn't get locked up. 15:00 dyoo: rich2: re bignums, there are several bignum libraries for javascript now 15:00 dyoo: WeScheme uses: https://github.com/dyoo/js-numbers 15:00 dyoo: and I know of at least two other bignum libraries out there. So that's not an issue anymore. ;) 15:00 paddymahoney: How widely used is the browser/ collection? 15:01 dyoo: unknown 15:01 paddymahoney: k 15:01 dyoo: historically, it was used for Help Desk, if I recall correctly. 15:01 rich2: kudos on your project! 15:02 dyoo: But got replaced by an external browser call at some point 15:03 paddymahoney: I see. I'm beginning work on migrating it, and wondering if I can replace the MZSCHEME= attribute with RACKET= attribute 15:04 paddymahoney: If a lot of external libs use it, I'll add a RACKET tag alongside the first, deprecate MZSCHEME= 15:04 dyoo: I'd recommend asking racket-dev about this one; I'm clueless. 15:06 paddymahoney: dyoo: k thanks for the info! 15:10 paddymahoney: is anyone aware of a racket/gui signature that obseletes mred/mred-sig? 15:12 dyoo: paddymahoney: hmm, no…. doing a quick scan 15:13 dyoo: couldn't find anything useful 15:14 paddymahoney: neither. I guess it stays then. 15:15 (quit) keppy: Ping timeout: 255 seconds 15:43 (join) dnolen 15:45 (part) epta 15:47 jaimef: how hard would it to be to decompile a binary compiled from a .rkt? 15:47 asumu: jaimef: you could `raco decompile` 15:48 jaimef: oh 15:52 (join) gridaphobe 15:53 (quit) acarrico: Ping timeout: 246 seconds 15:55 (quit) haiwei: Ping timeout: 255 seconds 15:57 (join) haiwei 16:00 (join) ijp` 16:01 rich2: does anyone use the drracket debugger? 16:02 rich2: i'd like a breakpoint rather than stepping over everything until the point i'd like to stop 16:03 (quit) ijp: Ping timeout: 252 seconds 16:03 (nick) ijp` -> ijp 16:04 dyoo: rich2: according to http://docs.racket-lang.org/drracket/debugger.html?q=debugger#(part._.Definitions_.Window_.Actions) 16:04 dyoo: you should be able to set breakpoints 16:06 dyoo: Do you see the pink circle when you hover over an expression's open paren? 16:08 rich2: dyoo: fantastic, yes 16:09 rich2: from the manual though for drracket i can't get "M-C-f : move forward one S-expression" to work, i keep getting the windows start menu appearing 16:10 rich2: i'm pressing ESCAPE-CTRL-F 16:10 rich2: as "On Windows and Mac OS X, Meta is only available through the Escape key." 16:10 dyoo: hmmm… checking something. 16:11 dyoo: In Preferences/General, is there something about meta keys there? 16:11 dyoo: Under Mac OS X, there's "Treat command key as meta" 16:11 dyoo: but I don't know what the situation's like on Windows. 16:12 rich2: i can't see it in the pref dialog 16:12 dented42: preferences -> editing -> general 16:13 rich2: yeh i looked in pref -> editing -> general, and pref -> general - i'm on windows xp sp3 16:13 samth: dyoo: almost certainly whalesong will be saner targeting JS directly than using something like emscripten/LLVM/asm.js 16:16 dyoo: samth: maybe. I do want to look at it regardless of practicality, and at the worst, I learn something new. :) 16:18 dyoo: rich2: for the combo ESCAPE-CTRL-F, are you tapping the escape key once, and then chording the control-f? 16:18 dyoo: rich2: it's following Emacs conventions in the absence of a separate meta key 16:19 (join) DaniG2k 16:19 DaniG2k: can someone plz explain let let* and letrec to me a bit better 16:19 DaniG2k: i dont quite get it 16:20 rich2: if i tap ESC, then CTRL+f, my cursor disappears 16:20 rich2: DaniG2k: use let* if the 2nd id references the 1st for example 16:21 rich2: eg. (let* ([x 1] [y (+ x 1]) (display y)) 16:22 rich2: oops. should be (let* ([x 1] [y (+ x 1)]) (display y)) 16:23 DaniG2k: ok so if i just use let then it doesn't reference the x 16:23 DaniG2k: what about letrec? 16:23 rich2: no - they are all "invisible" to each other in let - as i understand it 16:23 DaniG2k: still gives me two 16:23 rich2: letrec is like let* but can go both ways i think 16:24 dyoo: DaniG2k: in letrec, where you have something like (letrec ([f ]) …) 16:24 DaniG2k: dyoo: the documentation says its similar to let, not let* 16:24 (join) rohni 16:24 dyoo: in , you get to refer to the thing being bounded, f 16:24 jbclements: DaniG2K: in a letrec, all of the names bound by the letrec are in scope for all of the right-hand-sides of all of the bindings. 16:25 dyoo: so it's meant for things like recursive function definitions. 16:25 jbclements: DaniG2K: … though that doesn't mean that they've been evaluated yet. 16:25 rich2: DaniG2k: i was wrong about letrec, sorry. 16:26 jbclements: rudybot: (letrec ([even (lambda (x) (if (= x 0) #t #f))] [odd (lambda (x) (if (= x 0) #f #t))]) (odd 15)) 16:26 rudybot: jbclements: your sandbox is ready 16:26 rudybot: jbclements: ; Value: #t 16:26 (quit) gridaphobe: Remote host closed the connection 16:26 jbclements: ouch! just kidding. 16:27 (join) gridaphobe 16:27 jbclements: rudybot: (letrec ([even (lambda (x) (if (= x 0) #t (odd (- x 1))))] [odd (lambda (x) (if (= x 0) #f (even (- x 1))))]) (odd 15)) 16:27 rudybot: jbclements: ; Value: #t 16:28 jbclements: DaniG2K: in the example I just gave rudybot, the function 'even' is allowed to refer to 'odd', even though its binding appears later. 16:28 (join) jonrafkind 16:29 DaniG2k: jbclements: ok i see 16:29 DaniG2k: thanks 16:30 jbclements: first time I've used rudybot. That was awesome! :) 16:30 (quit) gridaphobe: Remote host closed the connection 16:30 DaniG2k: what's rudybot 16:30 dyoo: rudybot: what on earth are you? 16:30 rudybot: dyoo: Those lying "scientists" and their "theory of gravity" say that the earth is solid. 16:30 dyoo: see, that's rudybot. :) 16:31 DaniG2k: :P 16:31 dyoo: it's an IRC bot that says ridiculous things. And sometimes it evaluates racket expressions. 16:31 dyoo: rudybot: (+ "4" 2) 16:31 rudybot: dyoo: your sandbox is ready 16:31 rudybot: dyoo: error: +: contract violation expected: number? given: "4" argument position: 1st other arguments...: 2 16:32 DaniG2k: rudybot: '("test") 16:32 rudybot: DaniG2k: your sandbox is ready 16:32 rudybot: DaniG2k: ; Value: ("test") 16:32 DaniG2k: cool :D 16:32 dyoo: danig2k: https://github.com/offby1/rudybot 16:33 (quit) jonrafkind: Remote host closed the connection 16:34 (join) iartarisi 16:34 (quit) whoops: Quit: Farewell 16:36 (join) moe_4715 16:36 moe_4715: hi guys 16:36 iartarisi: hi! I'm just starting out with racket and am trying to use a redis library. One of the functions returns #\nul . What am I supposed to do with this value? or what kind of value is it? Where can I read more about it. 16:36 (join) whoops 16:36 dyoo: iartarisi: it's a character if I'm reading it right 16:37 dyoo: iartarisi: http://docs.racket-lang.org/guide/characters.html#%28tech._character%29 16:37 iartarisi: it's just like that, no quotes or anything 16:37 dyoo: More specifically, a unicode character point. 16:37 iartarisi: ah 16:38 moe_4715: i need your help for the following problem: 16:38 dyoo: In that specific case, it looks like it's ascii character 0. 16:38 iartarisi: so should I just run with it and do (char=? #\nul result) all over the place? or patch the library to return null instead? 16:39 dyoo: I'm not too familiar with redis. Where can I find out about it? 16:39 iartarisi: dyoo: http://redis.io/ 16:39 iartarisi: dyoo: from what you're saying I guess it might be part of its protocol to return ascii character 0 16:39 (join) quidnunc 16:40 moe_4715: i need a function where the input is a stream and the output is a stream with pairs of the input stream with ("hi" streamval) 16:40 moe_4715: here is my code: http://pastebin.com/VvMDXPym 16:40 dyoo: How should the null character be interpreted in this key/value store? Yeah, I'm not sure what it means semantically. 16:40 iartarisi: dyoo: no idea, I don't know much about the internal protocol, but I guess it's time to learn some. Anyway, thanks a lot! 16:40 (join) RacketCommitBot 16:40 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/GW3ixQ 16:40 RacketCommitBot: racket/master 17d6e16 Robby Findler: minor clarifications of the docs (that would have helped me... 16:40 RacketCommitBot: racket/master d403f3c Robby Findler: add docs to address how image equality, rounding, and alpha values... 16:40 (part) RacketCommitBot 16:40 moe_4715: please hlp! 16:41 moe_4715: i'm very desperate about the problem 16:41 jbclements: moe_4715: purpose statement? test cases? 16:42 samth: jbclements: the one-trick-tutor :) 16:42 jbclements: samth: purpose statement? test cases? 16:43 (join) jonrafkind 16:43 (quit) jonrafkind: Changing host 16:43 (join) jonrafkind 16:44 quidnunc: Can someone tell me what I am doing wrong in this simple macro? http://paste.lisp.org/display/135614 16:44 moe_4715: one moment, please 16:46 dyoo: quidnuc: does not compile. I don't know what lim is 16:46 dyoo: so perhaps your macro isn't actually being loaded. 16:47 (join) gridaphobe 16:47 moe_4715: http://pastebin.com/6kHjxERC 16:47 quidnunc: dyoo: should be x 16:47 quidnunc: sorry 16:48 quidnunc: I'm using geiser and C-x C-e doesn't seem to work all the time 16:48 moe_4715: that means for any input element it should output the same element paired with the value 0 16:49 moe_4715: let me say the input steram would be (1 stream), it would produce ((0 . 1) stream) out of it 16:49 jbclements: moe_4715: nice! not quite runnable test cases, but I think I see where you're going. 16:50 quidnunc: dyoo: So it does work, it was just as you said that the form wasn't loaded 16:50 quidnunc: dyoo: thanks 16:50 (join) keppy 16:50 dyoo: :) 16:50 moe_4715: then i am relieved :) 16:50 quidnunc: :( 16:50 jbclements: moe_4715: …. aaaaand, I've got to go run to get on a bus. Sorry! 16:50 didi: quidnunc: Are you evaling it in a visited file? 16:50 (part) jbclements 16:50 moe_4715: noooo :( 16:50 didi: quidnunc: If that's the case, you have to enter it first. 16:50 quidnunc: didi: yes 16:51 moe_4715: when are you back? 16:51 quidnunc: didi: Yes I have entered it 16:51 didi: oic 16:51 didi: quidnunc: So that's all I know. 16:51 didi: :^) 16:54 rich2: just wondering, why is range an open boundary - it catches me out everytime as i;m used to mathematica range. e.g Range[1, 10] -> [1..10], but (range 1 10) -> [1..9] 16:55 paddymahoney: is anyone else finding that Reindent All in DrRacket is causing right-ward creep in scribble files with @name[something]{} forms? 16:55 (join) RacketCommitBot 16:55 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/qeYoIg 16:55 RacketCommitBot: racket/master b40e38b Robby Findler: fix documentation errors... 16:55 (part) RacketCommitBot 17:00 (join) emma 17:00 (join) acarrico 17:01 (quit) gridaphobe: Remote host closed the connection 17:01 (join) Kaylin 17:01 (nick) emma -> em 17:02 (quit) hash_table: Ping timeout: 248 seconds 17:04 jonrafkind: whats the parameter to change the scribble font size 17:06 moe_4715: who of you can tell me how to define a stream with tuples in it? 17:07 moe_4715: i need to get a stream with e.g. (1 . stream) and need to make ('(0 . 1) . stream) 17:08 moe_4715: and then output the result for this 17:08 quidnunc: Is geiser-doc-symbol-at-point supposed to not contain actual documentation? 17:08 moe_4715: has anyone an idea how to do that? 17:08 didi: quidnunc: It has different results for guile and racket. 17:11 moe_4715: can anyone help? 17:12 didi: moe_4715: Do you know how to do it with lists? 17:13 moe_4715: i think so. maybe by doing (cons 0 (car )) 17:14 moe_4715: sorry, (cons (cons 0 (car ))) 17:14 didi: Nice. 17:14 moe_4715: and then the cdr... i forgot 17:15 moe_4715: but the same must be feasible with streams... 17:16 moe_4715: but the bad thing at it is that i can not assign a single element to a string-cons 17:16 paddymahoney: is there a way to figure out the safest amount of memory that the DrRacket limit can be set to, given the amount of OS memory? Anyone else with ridiculously high limits set? 17:16 (join) cdidd 17:20 didi: moe_4715: IIUC your problem, you can do it using the same method you would use with lists, just changing the appropriate procedure to one that operates at streams. 17:20 DaniG2k: guys i wrote a small function that takes a stream and returns a list of the values in the stream in order 17:21 DaniG2k: but my function sucks 17:21 (join) ijp` 17:21 DaniG2k: when i run it with a test stream that computes powers of two it freezes so easily 17:21 moe_4715: didi: which one would that be in this case? 17:21 moe_4715: didi: when i use stream-cons, i can only pass 2 streams 17:23 DaniG2k: http://hpaste.org/82861 17:23 DaniG2k: why is it so slow? 17:25 (nick) ijp` -> ijp 17:27 iartarisi: if (require json) doesn't work, does it mean I need a newer racket? 17:28 iartarisi: I'm on 5.2.1 17:28 moe_4715: think i got it 17:28 moe_4715: how can s.o. get the value out of an # 17:28 moe_4715: sequence? 17:30 moe_4715: (stream-append(cons 0 (stream-first pr))) --> thought that this would give me a stream?? 17:31 jaimef: if you had a week off to focus on learning racket enough to be dangerous what path would you take? 17:34 rich2: jaimef: learning racket from scratch? 17:35 jaimef: had many stabs at it, have the little schemer books. 17:35 jaimef: some elisp experience 17:35 jaimef: but still very new 17:37 rich2: i've never done any lisp/scheme before but used other languages - i'm just pretending i'm in my old language and converting at the moment, so i start with define/let/lambda/map/range 17:37 rich2: and setting little problems - that take about a screenful of code 17:37 jaimef: ahh 17:38 moe_4715: why this does not work? 17:38 moe_4715: (stream-first(stream-cons(cons 0 (stream-first ones)) (stream-rest ones))) 17:38 moe_4715: any idea? 17:38 moe_4715: ones is (define ones (lambda () (stream-cons 1 ones))) in this case 17:39 (join) cnonim 17:39 rich2: jaimef: you have any actual programs/scripts you need written? if so that'd be a good goal 17:39 (join) mizu_no_oto 17:39 jaimef: rich2: yeah I have some ideas 17:40 jaimef: racket was the only scheme I could find that would load this 13meg json file properly 17:40 moe_4715: (stream-cons(cons 0 (stream-first ones)) (stream-rest ones)) -> # ... but i am not able to apply stream-first 17:41 rich2: for example 1 problem i set myself in racket was to find the next 4 repeating digit prime numbers after the sequence, 2,3,5,7,11 - a repeating digit prime is a number expressed in decimal every digit is exactly the same 17:42 cnonim: how i can escape format string? (format "~a~a" "foo") == "foo~a" 17:42 rich2: only takes a couple of lines but gets you thinking of how the syntax and library functions co-operate 17:42 (quit) cdidd: Ping timeout: 248 seconds 17:43 asumu: rudybot: (format "~~a~a" "foo") 17:43 rudybot: asumu: your sandbox is ready 17:43 rudybot: asumu: ; Value: "~afoo" 17:43 asumu: cnonim: ^ 17:44 rich2: 13meg json - how long that take to parse? 17:44 cnonim: thx 17:44 asumu: moe_4715: I don't understand the question 17:44 asumu: rudybot: (define ones (lambda () (stream-cons 1 ones))) 17:44 rudybot: asumu: Done. 17:44 asumu: rudybot: (stream-first(stream-cons(cons 0 (stream-first ones)) (stream-rest ones))) 17:44 rudybot: asumu: error: stream-first: contract violation expected: (and/c stream? (not/c stream-empty?)) given: # 17:44 asumu: Oh, well, ones is not a stream. 17:44 asumu: It's a thunk. 17:45 asumu: rudybot: (define ones (stream-cons 1 ones)) 17:45 rudybot: asumu: Done. 17:45 asumu: rudybot: (stream-first(stream-cons(cons 0 (stream-first ones)) (stream-rest ones))) 17:45 rudybot: asumu: ; Value: (0 . 1) 17:46 moe_4715: oh, nice... then maybe you can also help me qith my problem... can i give you some code to check? 17:46 asumu: iartarisi: I don't think 5.2.1 has json. IIRC it was around 5.3. 17:47 moe_4715: here is my code: http://pastebin.com/htEDtnqV 17:47 cnonim: 'temp-dir points to /var/tmp ... which kind of find-system-path points to /tmp ? 17:47 iartarisi: asumu: thanks, I went with (planet mordae/redis:1:1) 17:47 moe_4715: it takes a stream, e.g. (1 . stream) and must return ('(0 . 1) . stream) 17:48 moe_4715: but this function returns a procedure instead of the wanted stream 17:48 (quit) stchang: Read error: Operation timed out 17:48 (quit) iartarisi: Remote host closed the connection 17:50 moe_4715: i need to call (stream-add-zero ones) and get back some stream 17:50 moe_4715: but it returns a procedure 17:51 asumu: The spacing and the indentation there makes it pretty hard to read. I recommend putting spaces between parens. 17:51 asumu: Also I think this is just the same issue. A thunk is not a stream. 17:51 asumu: rudybot: (stream? (lambda () 5)) 17:51 rudybot: asumu: ; Value: #f 17:52 asumu: rudybot: (stream? (lambda () (stream-cons 5 empty-stream))) 17:52 rudybot: asumu: ; Value: #f 17:52 (join) stchang 17:54 (join) gridaphobe 17:55 (quit) Kaylin: Quit: Leaving. 17:55 moe_4715: pls can someone help? 17:56 moe_4715: asumu: do you have any idea how to solve this? 17:56 asumu: moe_4715: see ^ 17:57 (join) cdidd 17:58 moe_4715: asumu: maybe there is a problem with the pr assignment? 18:00 asumu: I have to head out for dinner, but see my comments above. Cheers. 18:06 (join) anRch 18:07 dented42: I'm looking but can't find one, is there a way to convert a string into a syntax object? parsing the string through the reader and using datum->syntax would destroy the information that makes syntax objects interesting, like line numbers and positions and whatnot. 18:09 jonrafkind: read-syntax should preserve that information 18:10 jonrafkind: and also do datum->syntax for you 18:10 jonrafkind: i think read is normally implemented as (syntax->datum (read-syntax)) 18:11 dented42: oh ok, I was looking in the wrong place. 18:15 (join) jao 18:15 (quit) jao: Changing host 18:15 (join) jao 18:16 (quit) sethalves: Quit: ERC Version 5.3 (IRC client for Emacs) 18:17 (join) sethalves 18:20 (quit) rohni: Quit: Leaving. 18:25 (quit) mizu_no_oto: Quit: Computer has gone to sleep. 18:27 moe_4715: how can i take this code and modify it so that it returns a stream instead of a procedure? http://pastebin.com/pTyPXgZ2 18:29 (join) mizu_no_oto 18:31 paddymahoney: moe_4715: http://pastebin.com/bKzK2PKx 18:31 (quit) mizu_no_oto: Client Quit 18:32 moe_4715: paddymahoney: what did you change? 18:33 paddymahoney: moe_4715: f returns lambda's within each branch of the cond-these were removed. 18:33 moe_4715: ah, that's the trick.... thank you very much :) 18:33 paddymahoney: replaced with the expressions they thunk... 18:34 (quit) merijn: Ping timeout: 252 seconds 18:35 (quit) acarrico: Read error: Operation timed out 18:37 moe_4715: paddymahoney: can you please tell me hot so can check if a stream is finished? 18:38 moe_4715: i tried (null? (stream-first (pr) but think this is not correct 18:38 didi: rudybot: (require racket/stream) 18:38 rudybot: didi: your sandbox is ready 18:38 rudybot: didi: Done. 18:39 paddymahoney: moe_4715: http://docs.racket-lang.org/reference/streams.html?q=stream&q=drracket%3Atool^ 18:39 rudybot: http://tinyurl.com/b8ahulq 18:39 didi: rudybot: (stream-empty? '()) 18:39 rudybot: didi: ; Value: #t 18:41 moe_4715: paddymahoney: have you seen the error message? http://pastebin.com/HfWCTKuM 18:41 moe_4715: do you know why pr is suddenly a procedure? 18:42 moe_4715: that seems strange to me 18:45 didi: moe_4715: http://paste.kde.org/678854/ 18:45 (join) merijn 18:49 DaniG2k: why is it so slow? 18:50 moe_4715: didi: this is my problem in this case http://pastebin.com/iVR5h32x 18:51 moe_4715: and i'm currently working on it for 5 hrs 18:51 moe_4715: this drives me completely crazy 18:52 (quit) cnonim: Quit: WeeChat 0.4.0 18:52 (join) acarrico 18:52 (join) mizu_no_oto 18:54 didi: moe_4715: http://paste.kde.org/678860/ 18:56 (quit) anRch: Quit: anRch 18:56 didi: DaniG2k: `cons' will not delay the evaluation. 19:01 didi: rich2: re: range 19:01 (quit) andres-v`: Ping timeout: 244 seconds 19:02 (join) ambrosebs 19:06 dyoo: moe_4715: I haven't been following the thread here. It looks like you're doing streams? Which kind of streams? for SICP, or are you using the streams in the Racket standard library, or…? 19:07 (quit) DaniG2k: Read error: Connection reset by peer 19:10 (quit) rich2: Quit: Leaving. 19:11 dyoo: Unfortunately, my brain melted. Need to take a break. :) Talk later! 19:12 (quit) dyoo: Quit: dyoo 19:18 (join) Kaylin 19:19 (part) acarrico 19:21 (join) DaniG2k 19:22 DaniG2k: what's the key for multiline comments in racket? 19:22 didi: DaniG2k: #| |# 19:23 didi: Nah. #| #| 19:23 DaniG2k: thanks 19:23 DaniG2k: didi: first one was correct 19:24 didi: DaniG2k: Yeah, brain fart. Sorry. 19:24 DaniG2k: lol 19:26 (quit) jonrafkind: Ping timeout: 255 seconds 19:32 (join) jonrafkind 19:39 DaniG2k: if I have (define x 5) 19:39 DaniG2k: how can I negate x? 19:39 DaniG2k: just (- x) ? 19:41 jonrafkind: yes 19:41 jonrafkind: but the result will not be permanent 19:41 jonrafkind: do you want x to now store -5? 19:43 DaniG2k: hmmmm 19:43 DaniG2k: im not sure 19:43 DaniG2k: i have to write a stream 19:43 DaniG2k: that just prints out numbers from 1 to n 19:43 (quit) mizu_no_oto: Quit: Computer has gone to sleep. 19:43 DaniG2k: and if the number mod 5 is 0 then i need to return the negation of that number 19:43 DaniG2k: so I have 19:44 DaniG2k: (define number-stream 19:44 DaniG2k: (letrec ([f (lambda (x) (cons x (lambda () (if (= (remainder x 5) 0) (- x) (+ x 1)))))]) 19:44 DaniG2k: (lambda () (f 1)))) 19:44 (quit) ambrosebs: Remote host closed the connection 19:45 DaniG2k: doesn't seem to be working too well tho 19:47 (join) SunMoonStar 19:47 SunMoonStar: Can you use a let expression in a cond branch to be evaluated before the predicate? 19:48 jonrafkind: you can use it in the predicate 19:48 SunMoonStar: My issue is that I don't want an expression evaluated until a certain branch, but once I get to the branch, it will have to be evaluated multiple times after 19:49 jonrafkind: (cond [(let ([x 5]) (= x 5)) ...]) 19:49 jonrafkind: oh you want a let expression in the middle of some predicates? 19:49 jonrafkind: (cond [p1 p2 (let ...) p3 p4]) ? 19:49 jonrafkind: hm i see what you're saying 19:49 (quit) bitonic: Ping timeout: 248 seconds 19:50 jonrafkind: i would use nested cond's I guess 19:50 paddymahoney: moe_4715: http://pastebin.com/fbSj2rU9 19:50 jonrafkind: (cond [p1 p2 (else (let ... (cond ...))]) 19:50 SunMoonStar: Er, I think the first thing you said may be the answer. The problem to state more clearly is that it is evaluated in the branch predicate to see if it is true or false, but i want that to be the last time it is evaluated so that I don't have to eval it anymore because it will be used multiple times 19:50 jonrafkind: and a macro to make it look nice 19:50 (join) bitonic 19:51 jonrafkind: maybe (cond [p1 p2 [let x1 ...] p3 p4) where `let' is a keyword that macro knows about 19:51 jonrafkind: and it will produce hte nested conds for you 19:51 jonrafkind: where p3 and p4 are in the scope of the x1 binding 19:51 SunMoonStar: let's not go into macros yet ;P I'm not that far along 19:51 jonrafkind: well without macros you can still do a let + nested cond 19:52 jonrafkind: or actually theres another strategy -- use force/delay 19:52 jonrafkind: you can do (let ([x (delay ...)]) (cond [p1 p2 (force x)]) 19:52 jonrafkind: so delay makes x not be evaluated until the first force, then each subsequent force wont re-evaluate x, it will just get the value immediately 19:53 SunMoonStar: hm yes 19:53 SunMoonStar: but I don't know about else syntax in a cond statement. I have to look that up. I wanted to know if there was another way besides delay/force 19:53 (quit) Kaylin: Quit: Leaving. 19:53 jonrafkind: else just looks like any other predicate clause 19:54 jonrafkind: (cond [(blah?) ...] [else (printf "i got here")]) 19:54 SunMoonStar: ok so is else always the last branch? 19:54 jonrafkind: except obviously `else' is not evaluated 19:54 jonrafkind: yea 19:54 SunMoonStar: I was taught to use #t for the last branch 19:54 jonrafkind: ah 19:54 SunMoonStar: But anyway that does not matter, so else will not help me. I am trying to understand your other solution 19:54 jonrafkind: i guess theres no semantic difference, just using 'else' looks better 19:55 jonrafkind: and it has to be last, whereas #t can appear anywhere 19:55 (quit) bitonic: Ping timeout: 255 seconds 19:55 SunMoonStar: so this?: (07:50:18 PM) jonrafkind: (cond [p1 p2 (else (let ... (cond ...))]) 19:55 jonrafkind: yea 19:56 (join) bitonic 19:56 SunMoonStar: If there are only 2 branches, is it preferable to use if over cond? 19:56 jonrafkind: yea 19:57 SunMoonStar: I learned how to implement force and delay but is that in the language 19:57 jonrafkind: its in racket 19:57 SunMoonStar: ok 19:57 jonrafkind: are you using a student language? 19:57 SunMoonStar: No I'm learning racket 19:57 paddymahoney: moe_4715: http://pastebin.com/mY3jGcig 19:57 jonrafkind: its in racket/promise and racket 19:57 SunMoonStar: I will go with force/delay I feel like that is probably a perfect use case for it 19:57 jonrafkind: yes i think its better than nested conds 19:58 jonrafkind: although i dont know if theres an extra computational overhead.. 19:58 jonrafkind: but likely its small anyway 19:58 SunMoonStar: thanks 19:58 SunMoonStar: i love irc 19:59 jonrafkind: mos def 20:01 (quit) bremner: Ping timeout: 272 seconds 20:01 (join) bremner 20:01 (quit) bremner: Changing host 20:01 (join) bremner 20:02 DaniG2k: guys 20:03 (join) xulfer 20:05 paddymahoney: DaniG2k: hi 20:06 DaniG2k: hello 20:06 DaniG2k: I'm trying to get this function to work 20:06 DaniG2k: it's quite simple 20:06 DaniG2k: just prints out numbers from 1 to n 20:06 DaniG2k: but if n%5 == 0 then it prints out -n 20:06 DaniG2k: quite simple 20:06 DaniG2k: making it a stream 20:07 DaniG2k: so i have 20:07 DaniG2k: (define number-stream 20:07 DaniG2k: (letrec ([f (lambda (x) (cons x (lambda () (if (= (remainder x 5) 0) (f (- x)) (f (+ x 1))))))]) 20:07 DaniG2k: (lambda () (f 1)))) 20:07 DaniG2k: that's my stream 20:07 DaniG2k: but when i try using it 20:07 DaniG2k: i am getting values like 20:07 DaniG2k: '(1 2 3 4 5 -5 5 -5 5 -5 5) 20:07 DaniG2k: it's getting stuck 20:08 paddymahoney: so you know the problem is in the true branch of your if statement. 20:08 DaniG2k: yeah 20:08 (quit) jeapostrophe: Ping timeout: 276 seconds 20:08 DaniG2k: I tried with something like 20:08 DaniG2k: (- (+ x 1)) 20:09 DaniG2k: still doesn't work 20:09 DaniG2k: i get 20:09 DaniG2k: '(1 2 3 4 5 -6 -5 4 5 -6 -5) 20:10 paddymahoney: well, think about what you want-a stream with the negative of the number, stream-cons'ed to the rest of the stream. 20:11 paddymahoney: (stream (- x) (stream-rest s) 20:11 paddymahoney: ) 20:11 paddymahoney: sorry, (stream-cons (- x) (stream-rest s)) 20:11 DaniG2k: so the problem is with (cons x...) 20:11 (join) ijp 20:12 paddymahoney: I believe so. if number-stream is a stream and not a list, it needs to be constructed as a stream-cons, not cons. 20:13 paddymahoney: but it is difficult to work without the entirety of the code. 20:14 DaniG2k: paddymahoney: http://hpaste.org/82872 20:15 DaniG2k: paddymahoney: that will just print out the numbers from 1 to n in a strea 20:16 DaniG2k: stream 20:16 DaniG2k: but i will edit it now 20:16 DaniG2k: with an if statement 20:16 DaniG2k: (if (= (remainder x 5) 0) negate x, otherwise (+ 1 x)) 20:17 DaniG2k: thats what i think i need 20:17 DaniG2k: but im not sure 20:19 paddymahoney: ah-are you building your own streams again? 20:19 paddymahoney: are you in the same class as moe_4715? 20:19 DaniG2k: hmm not sure 20:19 DaniG2k: who that is 20:20 ozzloy: you want to negate x if it's divisible by 5? 20:20 DaniG2k: yeah 20:20 ozzloy: otherwise add 1 to x? 20:20 DaniG2k: (if (= (remainder x 5) 0) (- x) (+ x 1)) 20:20 ozzloy: what are you doing? 20:20 DaniG2k: but it gets stuck in a loop 20:20 DaniG2k: when i run 20:20 DaniG2k: (stream-for-n-steps funny-number-stream 11) 20:20 DaniG2k: i get 20:21 DaniG2k: '(1 2 3 4 5 -5 5 -5 5 -5 5) 20:21 DaniG2k: so its getting stuck 20:21 ozzloy: negative 5 is divisible by 5 20:21 ozzloy: so it gets negated 20:21 ozzloy: to 5 20:21 ozzloy: which is divisible by 5 20:22 DaniG2k: ah 20:22 DaniG2k: touche' 20:22 DaniG2k: (= (remainder (- 5) 5) 0) 20:22 DaniG2k: #t 20:22 DaniG2k: hmm 20:22 DaniG2k: so I'll have to return that and then add +1 20:22 ozzloy: you can also do -5 20:22 ozzloy: as the literal -5 20:23 DaniG2k: yeah 20:23 DaniG2k: but 20:23 DaniG2k: i cant do that on variables 20:23 ozzloy: x 20:23 ozzloy: yeah 20:23 DaniG2k: i need to call (- x) 20:23 DaniG2k: got it 20:23 ozzloy: just making sure. so what sequence are you aiming for? 20:24 DaniG2k: something like 20:24 DaniG2k: '(1 2 3 4 -5 6 7 8 9 -10) 20:24 DaniG2k: easy 20:24 DaniG2k: except for this negation :\ 20:24 DaniG2k: so ill have to cons the (- x) 20:24 DaniG2k: and then move up one 20:25 ozzloy: looks like you maybe want one variable that counts, and another variable that gets added to the list, based on the count 20:25 DaniG2k: jeez all these parentheses are tiring 20:25 ozzloy: or at least, that's what i'd do 20:25 DaniG2k: ozzloy: but i dont need to count since it's a stream 20:25 DaniG2k: another function takes care of counting 20:26 (join) acarrico 20:26 ozzloy: so you have one function take care of counting, and another function that computes what gets added to the list, based on that function 20:26 ozzloy: right now you're messing with the counting 20:26 ozzloy: or so it seems 20:27 DaniG2k: ok i think i figured it out 20:27 DaniG2k: i need a cond 20:27 ozzloy: oh, for the parens, i've not been too troubled by them, and i think it's because i started off using paredit mode in emacs from the beginning of my entry in to the lisp world 20:27 DaniG2k: if it's (negative? x) then make it positive and add one 20:27 DaniG2k: i think that should solve it 20:28 ozzloy: i almost always type open parens, and almost never type negative parens 20:28 ozzloy: er... close parens 20:30 ozzloy: i take it from the paste url that you use haskell? 20:30 ozzloy: i would like to learn haskell 20:30 ozzloy: i started reading learn you a haskell, seemed neat 20:31 ozzloy: wasn't high priority enough for me to stick with it at the time, though 20:31 (join) firefux 20:32 DaniG2k: nah using racket 20:32 ozzloy: ic 20:32 ozzloy: btw, you can use rudybot to do some stuff 20:33 ozzloy: rudybot, (display "hello world!\n") 20:33 rudybot: ozzloy: your sandbox is ready 20:33 rudybot: ozzloy: ; stdout: "hello world!\n" 20:37 DaniG2k: im close 20:38 DaniG2k: getting '(1 2 3 4 5 -6 7 8 9 10 -11) 20:38 (quit) gridaphobe: Remote host closed the connection 20:39 DaniG2k: bah 20:39 DaniG2k: i'll do this tmrw 20:39 DaniG2k: night all!! 20:39 (quit) DaniG2k: Quit: Leaving 20:42 (join) yacks 20:49 (quit) bitonic: Ping timeout: 256 seconds 20:54 (join) wdkrnls 20:55 (quit) moe_4715: Quit: Page closed 20:56 (join) Kaylin 21:01 (quit) ijp: Read error: Connection reset by peer 21:07 (quit) jonrafkind: Ping timeout: 248 seconds 21:08 (join) andres-v` 21:09 (quit) dnolen: Ping timeout: 264 seconds 21:16 (quit) jao: Ping timeout: 256 seconds 21:18 (join) dzhus 21:23 (join) ambrosebs 21:33 (join) jao 21:33 (quit) jao: Changing host 21:33 (join) jao 21:38 (join) ARCADIVS 21:46 jaimef ponders converting some awk over to racket for log parsing to sqlite 21:48 (join) gridaphobe 21:53 (quit) gridaphobe: Ping timeout: 264 seconds 21:53 (quit) didi: Ping timeout: 246 seconds 21:57 offby1: probably doable 21:58 offby1: I added sqlite stuff into rudybot a while ago, and it was pretty easy. 21:58 (join) Nisstyre-laptop 22:06 asumu: jaimef: there is http://docs.racket-lang.org/mzlib/mzlib_awk.html 22:06 asumu: Though I'm not sure it does exactly what you'd want. 22:06 asumu: And it should be revived and lifted out of mzlib if it's useful. 22:11 wdkrnls: how would you extend '+ to work with programmer defined data types? 22:12 offby1: I wouldn't. 22:12 offby1: Next question :) 22:12 wdkrnls: say I define a currency data type $ and I want to add two different data types. 22:12 wdkrnls: (+ ($ 10) ($ 20)) => ($ 30) 22:12 wdkrnls: :P 22:13 offby1: why not just add 10 to 20 and call it good? :) 22:13 asumu: wdkrnls: you can't do this with +, but in general you can use the racket/generic library to write such generic functions. 22:13 offby1: seriously, I think most schemers would write an "add-currency" function 22:13 (quit) ambrosebs: Remote host closed the connection 22:14 offby1: wdkrnls: next step: (+ (kg 2) (lbs 3)) => 7.4lbs 22:14 wdkrnls: offby1: exactly! my emacs calc does it, why not racket!? 22:16 (quit) acarrico: Ping timeout: 264 seconds 22:16 wdkrnls: asumu: is this because + isn't a function? 22:16 wdkrnls: asumu: like with or/and? 22:17 offby1: wdkrnls: I suspect it's a pretty hard problem -- but possibly worth doing. 22:17 asumu: rudybot: eval (require (prefix-in : +)) (struct foo (x)) (define (+ a b) (if (and (foo? a) (foo? b)) (+ (foo-x a) (foo-x b)) (:+ a b)) 22:17 rudybot: asumu: error: #:1:43: read: expected a `)' to close `(' 22:18 asumu: rudybot: eval (require (prefix-in : +)) (struct foo (x)) (define (+ a b) (if (and (foo? a) (foo? b)) (+ (foo-x a) (foo-x b)) (:+ a b))) 22:18 rudybot: asumu: error: #:1:22: +: standard-module-name-resolver: collection not found collection: "+" in collection directories: /mnt/racket-5.3.2/collects in: + 22:18 (quit) rmathews: Quit: ... 22:19 asumu: rudybot: eval (require (prefix-in : racket)) (struct foo (x)) (define (+ a b) (if (and (foo? a) (foo? b)) (+ (foo-x a) (foo-x b)) (:+ a b))) 22:19 rudybot: asumu: Done. 22:19 asumu: rudybot: (+ (foo 5) (foo 8)) 22:19 rudybot: asumu: ; Value: 13 22:19 asumu: wdkrnls: ^ 22:19 wdkrnls: asumu: awesome! 22:19 Nisstyre-laptop: rudybot: (thread (lambda () 3)) 22:19 rudybot: Nisstyre-laptop: your sandbox is ready 22:19 rudybot: Nisstyre-laptop: ; Value: # 22:20 asumu: Though it's not necessarily a good idea... overloading + can be confusing. 22:20 asumu: wdkrnls: Also, + is a function, but it's not defined as a generic one so you can't use racket/generic. 22:21 Nisstyre-laptop: just do what offby1 said and write currency-add 22:24 (quit) cataska: Remote host closed the connection 22:25 Nisstyre-laptop: you can define it pretty concisely too, if you have "on": (define $-add (compose $ (on + $-n))) 22:25 Nisstyre-laptop: on is "(define $-add (compose $ (on + $-n)))" 22:26 Nisstyre-laptop: er, (define (on f g) (λ (a b) (f (g a) (g b)))) 22:29 wdkrnls: on seems pretty cool, but even a decent currency function should have units and must take on the additional complexity of the time value of money. 22:29 wdkrnls: so, the problem is more like the physical units one offby1 mentioned. 22:29 Nisstyre-laptop: that is a good point 22:34 (join) jeapostrophe 22:36 (join) ambrosebs 22:40 wdkrnls: would it be possible to make racket return $10 or 10lb and have it understand that it is a specific data type, much like numbers? 22:43 wdkrnls: then I could evaluate expressions like: ($-add $10 €5) 22:45 (quit) racycle: Quit: racycle 22:45 (quit) keppy: Ping timeout: 264 seconds 22:45 (quit) quidnunc: Remote host closed the connection 22:46 (join) mithos28 22:47 offby1: I've always wanted values with units; I don't know of any language that has 'em 22:50 Fare: units? what kind of units? 22:50 offby1: pounds, dollars, etc 22:50 Fare: caml had units, maybe does again. 22:50 Fare: frink has units 22:50 Fare: F# has units. 22:50 offby1: really? 22:50 Fare: there may be a racket extension with units, for all I know 22:51 Fare: and maybe some macro systems for CL or Scheme. 22:52 (join) keppy 22:56 (quit) jeapostrophe: Read error: Operation timed out 22:58 (join) doomrobo 22:58 doomrobo: how do I match a parentheses with a regex? 22:59 doomrobo: I tried #rx"(" and #rx"\(" and neither work 22:59 doomrobo: *open parenthesis 22:59 mithos28: #rx"\\(" 22:59 doomrobo: why the double \? 23:00 mithos28: so \ is used as the escaping character in string literals 23:00 mithos28: so you need \\ to have a single \ in the actual string 23:00 doomrobo: ah, ok 23:00 mithos28: and \ is also used as the escaping characters in regexps 23:01 mithos28: and ( is special in regexps for matching groups 23:01 mithos28: rudybot: (regexp-match #rx"(.*)34" "1234") 23:01 rudybot: mithos28: your sandbox is ready 23:01 rudybot: mithos28: ; Value: ("1234" "12") 23:01 doomrobo: yeah, that part was familiar 23:02 (quit) keppy: Ping timeout: 264 seconds 23:02 doomrobo: also, where is string-split located? It's not in racket/string 23:03 mithos28: it is 23:03 mithos28: rudybot: doc string-split 23:03 rudybot: mithos28: http://docs.racket-lang.org/reference/strings.html#(def._((lib._racket%2Fstring..rkt)._string-split)) 23:03 mithos28: http://docs.racket-lang.org/reference/strings.html#(def._((lib._racket/string..rkt)._string-split)) 23:04 mithos28: offby1: you still around? 23:04 doomrobo: rudybot: (begin (require racket/string) (string-split "hello world")) 23:04 rudybot: doomrobo: your sandbox is ready 23:04 rudybot: doomrobo: ; Value: ("hello" "world") 23:04 doomrobo: odd, it gives me an undefined reference in my version 23:05 mithos28: what version are you using? 23:05 mithos28: I think it is a recent addition 23:05 doomrobo: 5.2.1 23:05 mithos28: yeah its newer than that 23:05 doomrobo: gotcha 23:05 mithos28: you can do regexp-split 23:05 mithos28: or just update 23:05 doomrobo: heaven forbid 23:06 Fare: [(] is a good way to escape the (, too 23:07 (join) keppy 23:07 Fare: nicer than \\ 23:07 Nisstyre-laptop: Fare: just use a character class you mean? 23:07 doomrobo: ohai Nisstyre-laptop 23:07 Fare: no, a singleton list of characters 23:08 Nisstyre-laptop: Fare: how does that apply to regexps? 23:08 doomrobo: Nisstyre-laptop, #rx"[(]" 23:08 mithos28: Fare: That is a character class 23:09 doomrobo: I think that is a character class Fare 23:09 Nisstyre-laptop: doomrobo: yeah a character class 23:09 Fare: whatever you call it 23:09 Nisstyre-laptop: a character class is sort of like a set 23:10 Fare: character class - string prototype - rune pattern - glyph object - sacred cow 23:12 Fare: codepoint set - letter recognizer - law officer 23:12 doomrobo: pilcrow 23:24 (part) firefux 23:26 (join) vipjun 23:31 (join) rmathews 23:39 (quit) keppy: Quit: leaving 23:47 (join) racycle 23:48 paddymahoney: Is anyone here familiar with units? I think I am running into a bug. 23:48 mithos28: paddymahoney: you mean like racket/unit? A bit. 23:49 paddymahoney: mithos28: right-racket/unit 23:49 paddymahoney: mithos28: I am running into an error that looks like: 23:50 (quit) rmathews: Quit: ... 23:50 paddymahoney: mithos28: define-unit/new-import-export: identifier exn:file-saved-instead1 is not present in old exports in: (define-unit/new-import-export browser@ (import setup:plt-installer^ mred^ url^) (export browser^) ((hyper^ html-export^ bullet-export^) pre-browser@ setup:plt-installer^ mred^ url^)) 23:51 paddymahoney: mithos28: problem-there is no identifier named exn:file-saved-instead1 -> it is named exn:file-saved-instead, and I have confirmed that the sigs and exporting unit refer to it as such. 23:51 mithos28: That does seem like a bug 23:52 mithos28: It is also over my head in terms of what you are doing with the units 23:52 paddymahoney: mithos28: ah k-thank you for your time :) 23:52 paddymahoney: I'm going to look into it further-it only came up upon migrating to racket/unit from scheme/unit 23:53 mithos28: what is using units? 23:53 paddymahoney: browser collection. 23:53 paddymahoney: I'm working on a fork to move the code to racket. 23:54 paddymahoney: it is pretty much done I think, aside from this issue.