00:55 (quit) jrslepak: Quit: Leaving 01:38 (join) mithos28 01:40 (quit) mithos28: Client Quit 01:50 (quit) jao: Ping timeout: 240 seconds 02:06 (quit) vu3rdd: Remote host closed the connection 02:54 (quit) Shviller: Ping timeout: 245 seconds 02:54 (join) Shviller 03:15 (quit) jonrafkind: Ping timeout: 260 seconds 03:21 (quit) avarus: Remote host closed the connection 03:55 (quit) realitygrill: Quit: realitygrill 04:08 (quit) noam: Read error: Connection reset by peer 04:09 (join) noam 04:11 (join) loz` 04:11 loz`: hi 04:11 loz`: how do i create multidimensional vector in racket? 05:15 (join) masm 05:33 (join) rekahsoft 05:52 (quit) masm: Quit: Leaving. 06:29 (join) keenbug 06:30 (join) MayDaniel 06:43 (quit) noam: Read error: Connection timed out 06:45 (join) noam 07:43 (quit) MayDaniel: Read error: Connection reset by peer 08:23 (join) zhang 08:25 (part) zhang 08:36 (quit) offby1: *.net *.split 08:36 (quit) cky: *.net *.split 08:36 (quit) tomku: *.net *.split 08:36 (join) offby1 08:36 (join) cky 08:36 (join) tomku 08:51 (join) veer 09:12 (quit) noam: Ping timeout: 260 seconds 09:16 (join) noam 09:24 (join) kenjin 09:25 (nick) kenjin -> Guest71065 09:32 (quit) Guest71065: Quit: Leaving 09:40 (join) ahinki 10:02 (quit) veer: Quit: Leaving 10:25 (join) kenjin2201 10:27 kenjin2201: Hello, I find it very hard to use macro in Racket than Common Lisp. Is it possible to write all macros that can be defined in Common lisp also in Racket? 10:31 bremner: I guess not. 10:31 bremner: they have different ideas about macros afaik 10:33 kenjin2201: It is really hard to learn 10:33 kenjin2201: It is almost impossible to convert macros i've written befor in CL into Racket 10:36 bremner: I'm afraid I only know a little about theoretical differences between the two macro systems, nothing practical. 10:36 bremner: Racket uses "hygenic" macros. CL not, iirc 10:36 bremner: that is about all I know ;) 10:36 (join) anRch 10:37 bremner: http://www.ccs.neu.edu/home/matthias/369-s10/Transcript/mm.html 10:37 bremner: http://www.ccs.neu.edu/scheme/pubs/dissertation-culpepper.pdf 10:37 kenjin2201: Oh thank you 10:37 bremner: tbh, those are from me "should read someday" list 10:38 (join) Blkt 10:40 kenjin2201: It looks very hard at a glance :) 10:40 bremner: yeah, there must be an easier reference. 10:46 (join) MayDaniel 10:48 bremner: did you look at http://docs.racket-lang.org/syntax/index.html 10:50 (quit) Blkt: Read error: Connection reset by peer 10:52 (nick) samth_away -> samth 10:53 kenjin2201: bremner // Yeah I did, I can write simple macros, but as it gets complicated it easily becomes almost impossible to write unlike in Common lisp 10:54 samth: kenjin2201: here's an introduction to macros in Racket: pre.racket-lang.org/docs/html/guide/macros.html 10:54 samth: kenjin2201: you can write (almost) any macro you can write in CL in Racket, and lots more that you can't write in CL 10:55 samth: the (almost) is for a very small set of macros that behave very badly 10:55 (quit) noam: Read error: Connection reset by peer 10:56 kenjin2201: Oh...what's really hard for me is that i cannot easily separate parts of the code using functions that generate code for the macro which I've been doing with Common lisp usually. 10:57 kenjin2201: It's hard to handle syntax object easily. It's much more easier for me to simple deal with s-expressions 10:58 samth: kenjin2201: you can definitely separate out helper functions for using with macros 10:59 kenjin2201: But those functions should handle syntax objects instead of s-exps right? 10:59 samth: rudybot: (define-for-syntax (stx-map f sl) (map f (syntax->list sl))) 10:59 rudybot: samth: your racket/init sandbox is ready 10:59 rudybot: samth: Done. 11:00 samth: kenjin2201: yes, like i just showed 11:00 kenjin2201: does syntax->list generate a list of syntax objects? 11:01 samth: kenjin2201: yes 11:01 samth: rudybot: doc syntax->list 11:01 rudybot: samth: http://docs.racket-lang.org/reference/stxops.html#(def._((quote._~23~25kernel)._syntax-~3elist)) 11:01 samth: offby1: has rudybot gotten faster recently? 11:03 kenjin2201: samth: I couldn't use some functions like remove-duplicates. The compiler says it's unbound id in transformation environment or something 11:04 samth: kenjin2201: you have to load it into the environment for macro expansion 11:04 samth: rudybot: (require (for-syntax racket/list)) 11:04 rudybot: samth: Done. 11:05 kenjin2201: Should I use module system? 11:05 samth: rudybot: (begin-for-syntax (remove-duplicates '(1 1 3 4 5 2 4 5 2))) 11:05 rudybot: samth: Done. 11:05 samth: kenjin2201: yes, you should use the module system 11:06 kenjin2201: Thank you very much. It seems that it's going to take some time for me to get used to it 11:07 samth: kenjin2201: another good intro for people used to common lisp is this blog post by eli: http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html 11:08 kenjin2201: samth: Yeah, I've read it. It helped me a little. 11:08 kenjin2201: One question. 11:09 samth: another good tutorial is this article (not specifically about Racket, but it will apply): http://www.cs.indiana.edu/cgi-bin/techreports/TRNNN.cgi?trnum=TR356 11:09 kenjin2201: is with-syntax only to use some non-hygienic property? 11:10 samth: kenjin2201: no, with-syntax is just a general binding form 11:10 kenjin2201: like let? 11:10 samth: yes, but for variables that are used to construct syntax 11:10 samth: for example: 11:11 samth: rudybot: (with-syntax ([x #'foo]) #'(x x)) 11:11 rudybot: samth: ; Value: # 11:11 kenjin2201: samth: Variables must be bound to syntax objects. right? but i saw a strange example 11:12 samth: if you bind something using with-syntax, it gets converted to a syntax object 11:12 kenjin2201: Oh. So they dont have to be syntax objects. I see 11:13 samth: rudybot: (with-syntax ([x 17]) #'(x x)) 11:13 rudybot: samth: ; Value: # 11:14 kenjin2201: is 17 equivalent to #'17 in the above context 11:14 kenjin2201: ? 11:15 samth: yes, they would behave exactly the same 11:15 samth: although they'll end up with slightly different source location information 11:16 kenjin2201: Oh, I was wondering what source location means. 11:17 samth: kenjin2201: source location is where the syntax object came from -- it's how racket gives good error messages 11:19 kenjin2201: So it's irrelevant to how the program actually works ? 11:20 samth: kenjin2201: well, you can write macros that depend on them, but that would be pretty bad style 11:21 (quit) MayDaniel: Read error: Connection reset by peer 11:22 kenjin2201: samth: You really saved me. Thank you. 11:23 samth: kenjin2201: no problem 11:26 kenjin2201: One final question, once I get accustomed to hygienic macro, then I can write macros in Racket as easily as in common lisp, no matter complicated it is. 11:26 samth: yes 11:26 kenjin2201: Great 11:26 samth: i've written some very complicated macros in Racket (for example, `racket/match' and `typed/racket') 11:27 samth: and also, `syntax-case' and `syntax-rules' and `class' and `define' and `unit' and `syntax-parse' and many other things are written in macros in Racket 11:29 kenjin2201: Wow.... Is it possible to read the source? 11:33 (quit) anRch: Quit: anRch 11:34 samth: kenjin2201: yes 11:35 kenjin2201: I would't be able to understand it anyway. You must be a famous person here. Thank you for your time. 11:36 samth: here's the source of `racket/match': https://github.com/plt/racket/blob/master/collects/racket/match/match.rkt 11:36 samth: or the beginning of it, anyway 11:37 kenjin2201: Matthew Flatt....I've seen your name thousands of times. 11:37 samth: I'm not matthew :) 11:37 samth: here's the source to syntax-rules and syntax-case: https://github.com/plt/racket/blob/master/collects/racket/private/stxcase-scheme.rkt 11:37 rudybot: http://tinyurl.com/78z8hcq 11:38 samth: kenjin2201: Matthew doesn't hang out on IRC much 11:38 samth: he's just the last person to commit to the repository 11:38 samth: which is why Github shows that commit there 11:39 kenjin2201: Oh I see. I'm not actually a programmer. Sorry for my ignorance 11:39 samth: if you're writing macros, you're certainly a programmer 11:40 kenjin2201: :) 11:42 kenjin2201: I was trying to write a macro that defines functions using pattern match like in Haskell. I've been using that macro in Common lisp. So I tried to apply the same to Racket. But failed. 11:44 offby1: Cool story, bro 11:47 samth: kenjin2201: here's a simple definition of such a macro 11:48 samth: rudybot: (define-syntax-rule (define/match f clauses ...) (define f (match-lambda clauses ...))) 11:48 rudybot: samth: Done. 11:49 samth: rudybot: (define/match f [1 1] [0 1] [n (* n (f (sub1 n)))]) 11:49 rudybot: samth: Done. 11:49 samth: rudybot: (f 5) 11:49 rudybot: samth: ; Value: 120 11:49 samth: kenjin2201: there you go 11:50 kenjin2201: Oh...great 11:51 kenjin2201: I was thinking something like (def (fact 1) 1 (fact n) (* n (fact (- n 1))) ...) 11:52 samth: that's a little bit trickier 11:52 kenjin2201: It was hard to take function names out of the pairs and build (define ..) forms 11:55 kenjin2201: It was simple to implement in Common lisp 11:58 samth: kenjin2201: https://gist.github.com/1380486 12:00 (join) dnolen 12:00 kenjin2201: You are really great!! 12:02 samth: well, syntax-parse is great, i'm just the messenger :) 12:03 samth: now even shorter 12:04 samth: now with multiple arguments 12:04 kenjin2201: Yeah. 12:04 kenjin2201: if i define other functions in def 12:21 (quit) keenbug: Ping timeout: 276 seconds 13:05 (join) realitygrill 13:16 (join) keenbug 13:17 (quit) kenjin2201: Remote host closed the connection 13:22 (join) tyson1 13:35 (part) tyson1 13:43 (join) jonrafkind 13:58 ozzloy: is there a quicker way to do (for/list ([x xs] [y ys]) (list x y)) ? something like (zip xs ys) ? 13:58 jonrafkind: rudybot: (require srfi/1) (zip '(1 2 3) '(a b c)) 13:58 rudybot: jonrafkind: epub is basically a zip file containing html and some meta data. I know enough elisp to hobble a working prototype together but would love to see it developed a bit more 13:59 jonrafkind: whatever, that should work 13:59 jonrafkind: ozzloy, if you search for 'zip' in the docs srfi/1 is the 2nd result 14:00 ozzloy: oh, i searched zip and saw a bunch of file/zip gzip stuff, didn't notice the second one 14:01 ozzloy: what is srfi? 14:01 ozzloy: nm 14:01 ozzloy: jonrafkind, thanks 14:04 samth: rudybot: eval (require srfi/1) (zip '(1 2 3) '(a b c)) 14:04 rudybot: samth: error: with-limit: out of time 14:04 samth: also: 14:05 samth: rudybot: (map list '(1 2 3) '(a b c) 14:05 rudybot: samth: FB have written a compiler that translates a subset of PHP to C++ 14:05 samth: rudybot: (map list '(1 2 3) '(a b c)) 14:05 rudybot: samth: ; Value: ((1 a) (2 b) (3 c)) 14:05 ozzloy: oh, nice 14:06 samth: rudybot: eval (require srfi/1) (zip '(1 2 3) '(a b c)) 14:06 rudybot: samth: ; Value: ((1 a) (2 b) (3 c)) 14:11 ozzloy: http://www.ruby-doc.org/core-1.9.3/Enumerable.html#method-i-zip wow, ruby's documentation has gotten much nicer 14:17 (quit) keenbug: Ping timeout: 240 seconds 14:19 (join) MayDaniel 14:28 (quit) MayDaniel: Read error: Connection reset by peer 14:42 (join) samth_ 14:47 (quit) samth_: Ping timeout: 252 seconds 14:48 (join) jaimef 14:50 (join) keenbug 14:52 (join) avarus 14:58 (join) noam 15:02 (join) MayDaniel 15:02 (quit) MayDaniel: Read error: Connection reset by peer 15:35 (join) MayDaniel 15:38 (quit) MayDaniel: Read error: Connection reset by peer 16:04 (quit) noelw: Ping timeout: 244 seconds 16:14 (quit) ahinki: Quit: ChatZilla 0.9.87 [Firefox 7.0.1/20110928224103] 16:30 jaimef: anyone use emacs vs drracket? 16:36 bremner: I use emacs with geiser 16:36 samth: jaimef: yes, lots of people do 16:37 samth: there's lots of info on how to integrate them here: http://pre.racket-lang.org/docs/html/guide/other-editors.html?q=editor 16:37 jaimef: thanks 16:37 (quit) keenbug: Read error: Operation timed out 16:38 jaimef: coming off a 3 day stint on CL and a friend recommended this. 16:53 samth: if only everyone had such clever friends ... 17:01 jaimef: is the repl in geiser more like lispy repl? e.g. no "run" needed 17:05 samth: jaimef: yes 17:07 jaimef: thanks 17:10 (join) epsil 17:14 epsil: if I type #lang racket in the repl, I get a "not enabled in the current context" error 17:14 epsil: this means I cannot send a script containing #lang racket to the repl from emacs 17:14 epsil: how do I resolve this? 17:16 (join) MayDaniel 17:21 samth: epsil: you can set (read-accept-reader #t) 17:21 samth: rudybot: doc read-accept-reader 17:21 rudybot: samth: http://docs.racket-lang.org/reference/Reading.html#(def._((quote._~23~25kernel)._read-accept-reader)) 17:22 samth: however, sending modules defined with #lang is unlikely to do everything you want anyway -- for example it won't get a useful name 17:23 ozzloy: epsil, mabye you want: ,enter "filename" instead? 17:23 epsil: well I'm still struggling with my first hello world script ;) 17:23 epsil: I'm not sure what I want 17:24 ozzloy: http://www.nongnu.org/geiser/geiser_3.html#Switching-context 17:24 ozzloy: if you want the functions in file "foo.rkt" available in the repl, do ,enter "foo.rkt" at the repl 17:25 ozzloy: epsil, ^ 17:25 ozzloy: assuming you got to the repl 17:26 ozzloy: tell me to shut up if i'm telling you stuff you already know 17:28 epsil: ,enter "hello.scm" in the repl gives the error "unquote: not in quasiquote in: (unquote enter)" ... 17:28 samth: epsil: try (enter! "hello.scm") 17:28 samth: and then also try XREPL 17:29 samth: rudybot: doc xrepl 17:29 rudybot: samth: not found in any library's documentation: xrepl 17:29 samth: rudybot: (require xrepl) 17:29 rudybot: samth: Done. 17:29 samth: rudybot: doc xrepl 17:29 rudybot: samth: not found in any library's documentation: xrepl 17:29 samth: http://pre.racket-lang.org/docs/html/xrepl/index.html?q=xrepl 17:30 epsil: samth: that works (provided the file contains #lang racket) 17:31 ozzloy: epsil, are you using the repl started by running M-x run-racket ? 17:31 epsil: seems I don't have xrepl, though 17:31 ozzloy: epsil, also what version of racket do you have installed? 17:32 epsil: ozzloy: no, I just set scheme-program-name to "racket" in .emacs 17:32 epsil: my version is 5.1.1 17:32 ozzloy: oh, i'm sorry, i thought you were using geiser 17:33 epsil: I'm using the standard scheme-mode 17:33 ozzloy: ic. idk anything about that. 17:34 samth: epsil: does `enter!' work for you? 17:36 epsil: samth: if I type just "enter!" in the repl, it complains about bad syntax 17:38 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/DvusNw 17:38 RacketCommitBot: [racket/master] adjust number-snip% so that it subscribes to the file/convertible - Robby Findler 17:39 epsil: anyhow, how do I make (read-accept-reader #t) permanent? is there a .racketrc file or something where I should put start-up settings? 17:40 samth: epsil: you need to do (enter! "hello.scm") 17:41 samth: also, there is a .racketrc file which you can add things to 17:41 (join) lucian 17:41 (quit) MayDaniel: Read error: Connection reset by peer 17:41 lucian: noob, os-specific question: under what name does ubuntu package DrRacket? 17:42 epsil: lucian: racket or racket-common 17:42 epsil: I installed both and have it 17:43 epsil: samth: yeah, (enter! "hello.scm") works 17:43 lucian: epsil: ah, ok. i'd assumed that package only had the cli tools and went to the website (which has slow mirrors). thanks 17:44 jaimef loves the clear documentation for racket. This is insanely great. given 3 days of trying to grok, or rather find documentation for working CL examples. 17:44 jaimef: #!/usr/bin/env racket ;; I mean like omfg 17:45 ozzloy: indeed, kudos to the documentation team/person. the guide 17:45 ozzloy: i keep referencing the guide again and again 17:51 samth: ozzloy, jaimef: that's mostly matthew flatt 17:51 samth: eli: ping 17:53 samth: eli: who is the current maintainer of the eopl language? 17:54 ozzloy: lucian, are you running ubuntu 11.10? 17:55 ozzloy: samth, oic 17:56 lucian: ozzloy: yeah 17:56 ozzloy: lucian, ah. i needed to add a ppa. did you? 17:57 ozzloy: oh but i'm on 11.04 17:57 lucian: ozzloy: nope 17:57 (quit) lucian: Quit: Leaving 17:58 jonrafkind: thats funny, now he won't get the package 18:04 epsil: hm 18:05 epsil: even though I do (read-accept-reader #t), I still cannot enter #lang racket in the repl 18:05 epsil: I get the same "#lang not enabled in the current context" message 18:05 epsil: how do I enable it? 18:06 samth: you should also set (read-accept-lang #t) 18:06 epsil: samth: yeah, I've done that too 18:08 samth: hmm, i see that too, but i'm surprised 18:08 samth: you can use (module my-module-name racket ...) 18:12 epsil: maybe it's a bug? 18:14 ozzloy: epsil, have you considered geiser? 18:16 (quit) avarus: Remote host closed the connection 18:18 epsil: ozzloy: well I tried quack 18:18 epsil: same issue 18:18 epsil: I don't think the problem lies with emacs in this case 18:20 (quit) rekahsoft: Ping timeout: 252 seconds 18:20 epsil: I mean, if geiser does likewise and sends the whole file including #lang to the repl, I will get the same error 18:21 epsil: unless geiser has a special file-loading command customized to the peculiarities of racket's repl 18:22 (join) rekahsoft 18:22 bremner: well, you can certainly send files with #lang racket in them to the repl in geiser 18:22 (quit) jonrafkind: Ping timeout: 245 seconds 18:22 bremner: maybe I misunderstood the question. 18:23 epsil: bremner: what is the geiser command for that? 18:23 ozzloy: epsil, http://www.nongnu.org/geiser/geiser_3.html#Switching-context this page does say ",enter" is geiser-defined 18:23 bremner: C-c C-a 18:23 ozzloy: so maybe? 18:25 epsil: iiuc, geiser recognizes the file as a module and reloads it as such 18:33 (join) masm 18:35 epsil: okay, so why is (enter! "file.scm") okay, but (enter! "/home/epsil/file.scm") is not? 18:35 epsil: "not a valid module path" 18:36 ozzloy: maybe current-directory is automatically prepended 18:37 epsil: is there a parameter for that? 18:37 epsil: something I can toggle in .racketrc, or ... 18:38 samth: try (enter! '(file absolute-path)) 18:39 epsil: that works 18:40 epsil: one step closer now 18:42 epsil: no. 18:56 epsil: okay, so does (enter! ...) ignore the file unless it has changed on disk? 18:56 (join) jao 18:56 epsil: if I do (enter! (file "hello.scm")) twice in a row, nothing happens the second time 18:57 epsil: hello.scm being a very simple script containing the following: (define (hello-world) (printf "Hello world!\n")) (hello-world) 18:58 samth: epsil: requiring a file twice in racket is the same as requiring it once 18:59 samth: see the documentation here: http://pre.racket-lang.org/docs/html/reference/enter.html?q=enter!#%28form._%28%28lib._racket/enter..rkt%29._enter!%29%29 18:59 rudybot: http://tinyurl.com/7kp3jf7 19:01 epsil: well then, I don't want to require the file 19:02 epsil: I want to /load/ it 19:02 samth: epsil: code in modules is requred 19:02 samth: what are you trying to accomplish? 19:02 epsil: samth: I want to execute the code in hello.scm in the repl 19:03 epsil: repeatedly if I wish 19:03 samth: i recommend calling the hello-world function multiple times then 19:04 epsil: hello.scm does call the hello-world function 19:04 samth: yes, i understand that 19:05 epsil: but I can only load a file once. after that, I have to invoke this function or that manually. 19:05 epsil: is that how it works? 19:05 samth: yes, loading of code isn't something that happens multiple time (modulo more complicated issues like namespaces) 19:08 epsil: what if I want to make a change to my hello.scm file? 19:08 epsil: what then? 19:09 epsil: i don't understand 19:09 epsil: i have a script 19:09 epsil: i want to make changes to it 19:10 bremner: in geiser, C-c C-a as many times as you like 19:10 bremner: effectively the same as Run in DrRacket, I guess. 19:10 epsil: but geiser uses (enter! ...), which doesn't reload the file 19:10 epsil: or does it 19:10 epsil: I'm lost 19:11 samth: epsil: geiser doesn't use enter! 19:11 samth: also, enter! will run your file again if it's changed 19:11 epsil: samth: what does geiser do, then? 19:12 samth: epsil: geiser uses lower-level mechanisms to do similar things 19:12 samth: just like DrRacket does 19:12 samth: and just like enter! does 19:13 epsil: sounds complicated 19:13 epsil: nothing simple I can hack up myself? 19:13 epsil: I wrote an elisp function for (enter! ...), which worked except when it didn't 19:14 samth: epsil: yes, it's complicated 19:14 samth: why do you want to hack something up yourself? 19:14 samth: geiser is excellent 19:14 samth: jao did a very good job 19:15 epsil: because I just need this single command 19:15 epsil: send a file to the repl 19:15 epsil: that's all I'm interested in. 19:16 samth: then probably enter! will work for you, since it reloads on changes 19:18 epsil: yes, but ... 19:18 epsil: I want to reload always 19:20 samth: epsil: what version of racket do you have 19:21 samth: if you have a recent version, you can use xrepl, where the ,enter command will do what you want 19:21 epsil: 5.1.1 19:21 epsil: I don't have xrepl 19:22 samth: ok, then i recommend using geiser 19:23 epsil: seems like the only alternative 19:23 samth: epsil: or using drracket, or getting a newer version of racket, or just using enter! 19:25 epsil: yeah :) 19:26 epsil: well I'm signing off 19:26 epsil: thanks for the help 19:28 (quit) epsil: Quit: WeeChat 0.3.5 19:44 (quit) masm: Quit: Leaving. 20:20 (quit) noam: Read error: Connection reset by peer 20:21 (join) noam 20:29 (join) freakazoid 20:35 (nick) samth -> samth_away 21:21 (join) jonrafkind 22:28 (quit) jonrafkind: Ping timeout: 260 seconds 22:49 (quit) rgrinberg: Read error: Connection reset by peer 22:50 (join) noelw 22:52 offby1: Any obvious reason why I might get "empty" profiling results from profile-thunk? --> http://ix.io/1YV 23:01 (join) mithos28 23:11 (quit) rekahsoft: Ping timeout: 258 seconds 23:13 (join) rekahsoft 23:45 (quit) rekahsoft: Ping timeout: 248 seconds 23:46 (join) rekahsoft 23:51 (quit) rekahsoft: Ping timeout: 240 seconds 23:52 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/9kRf-A 23:52 RacketCommitBot: [racket/master] added support for where & side-condition & judgment-holds to define-relation - Robby Findler 23:52 RacketCommitBot: [racket/master] adjust define-judgment-form so that it - Robby Findler 23:53 (join) rekahsoft 23:55 (join) anacrolix