00:07 (join) jonrafkind 00:28 (quit) dnolen: Quit: dnolen 01:07 (quit) veer: Quit: Leaving 01:14 (quit) realitygrill: Quit: realitygrill 01:23 (quit) jeapostrophe: Quit: jeapostrophe 01:29 jao: danking, eli, i'm afraid xrepl doesn't work in geiser. i'm using my own unquoting mechanism and a customized repl there. 02:18 (quit) jonrafkind: Ping timeout: 260 seconds 02:24 (join) dmac1 02:28 mithos28: Is there a way to get set! to support l-values? 02:33 (join) hkBst 02:38 (quit) wtetzner: Ping timeout: 248 seconds 02:43 (join) wtetzner 02:45 (quit) dmac1: Ping timeout: 258 seconds 03:24 (join) dmac1 03:24 (nick) elliottcable -> elli 03:28 (nick) elli -> elliottcable 03:32 (join) ahinki 03:33 (join) tim-brown 03:33 (join) Blkt 03:36 (quit) mithos28: Quit: mithos28 03:37 (nick) elliottcable -> llttcbl 03:38 Blkt: good morning everyone 03:45 (nick) llttcbl -> elliottcable 03:49 tim-brown: mornin Blkt, mornin all 03:49 Blkt: :) 03:50 tim-brown: llttcbl: i see you've joined #vim. do you use embedded :mz in vim? 04:00 (quit) slilo: Ping timeout: 258 seconds 04:19 (join) masm 04:21 (join) bluezenix 04:25 (join) sid0 04:26 sid0: Hi, I'm new to Racket and have what seems to be a newbie question on macros 04:28 (quit) karswell: Read error: Operation timed out 04:29 (join) karswell 04:29 sid0: http://paste.lisp.org/display/125262 04:30 sid0: What seems to be happening is that the fname in the with-syntax pattern doesn't get replaced with bar 04:33 sid0: I'm probably missing something pretty basic here :) 04:48 sid0: Sorry, I guess it's not really clear enough from my example. Here's a more involved example: http://paste.lisp.org/display/125263 04:49 sid0: I'm trying to write an unhygienic macro following from http://calculist.blogspot.com/2008/03/intentional-capture.html 04:50 sid0: which plops my function in for the given one in the syntax's lexical context 05:36 hkBst: sid0: you're syntax-binding fname1, but you're calling fname2..., plus you're trying to bind a symbol, instead of the argument to your macro, see my annotation to your second paste 05:36 (quit) xharkonnen_: Quit: Leaving 05:39 sid0: hkBst: thanks, but that's still printing out bar 05:40 hkBst: sid0: yes, looking closer at your source, I must admit, I'm unclear what you're trying to accomplish 05:40 sid0: hkBst: yeah I realize my example sucks 05:41 sid0: coming up with a better one now 05:46 sid0: hkBst: ooh 05:47 sid0: hkBst: http://paste.lisp.org/display/125268 is a better example of what I'm trying to do 05:47 sid0: hkBst: but I see you mentioned the solution already, since changing the second argument of (datum->syntax #'op 'replace-id) to #'replace-id causes it to work 05:48 sid0: hkBst: but I'm not sure why, since isn't the second argument of datum->syntax supposed to be a datum and not a syntax object? 05:53 hkBst: sid0: yes, in this new macro I can see it makes more sense this way :) 05:53 eli: jao: Any inherent reason that it won't work? It's a pity that both tools are so close but they won't work together. 05:53 eli: sid0: What are you trying to do, exactly? (Description, not these examples...) 05:54 sid0: eli: given a lambda with a call to another function inside the lambda I want to replace the callee with my own function 05:55 eli: sid0: And the name that you're trying to replace is always the same? 05:55 sid0: No, I'd like to pass that in as an argument to the macro 05:56 sid0: I had managed to get it to work for the constant case 05:56 sid0: but I was having trouble generalizing that 05:56 eli: Um, if you pass it in as an argument, then there is no need for breaking hygiene in any way... 05:56 sid0: as an argument to the *macro*, not the lambda :) 05:57 sid0: the lambda's already specified and the function callinside's bound beforehand 05:57 eli: Just rewrite (foo old new (lambda (x ...) body ...)) -> (lambda (x ...) (let ([old new]) body ...)) 05:57 jao: eli, i use my own evaluator to introduce meta-commands that are used by geiser to interact with racket from code buffers, and to keep track of modules loaded and such (i have a slightly modified version of enter!) 05:58 sid0: eli: Ah, I remember trying that but not getting it to work 05:58 sid0: eli: I should try it again I guess 05:58 eli: sid0: Yeah, that would be more useful. 05:59 eli: jao: Then why not make geiser just use xrepl directly then? 05:59 jao: eli, i could take xrepl's as a starting point to my extensions, 05:59 eli: jao: I'd be happy to help if there's anything that is needed... 05:59 jao: eli, yes, exactly. just a matter of finding a time slot. 05:59 eli: BTW, what's different in your `enter!' variant? 06:00 jao: eli, thanks. i'll take a look. i'd be actually happy to take advantage of your work 06:00 eli: jao: And the `enter!' question? 06:00 jao: eli, iirc, i'm keeping track of module loading in my enter!, to avoid loading modules when doing the autodoc thing 06:01 eli: Why is that needed? 06:01 eli: If a module is loaded you won't pay the price for reloading it, so that shouldn't be a problem. 06:01 jao: eli, i don't want modules to be loaded unless the user explicitly asks for them 06:02 jao: or, at least, i didn't want back in the day :) 06:02 eli: I'm not following how that's related to entering a module... 06:02 eli: Perhaps you're trying to know which modules are currently instantiated? 06:02 sid0: eli: yeah, it works :) now to figure out what I was doing wrong then 06:03 eli: sid0: If you're new to Racket and coming from CL, it's best to just avoid the temptation to try unhygienic macros. 06:03 jao: eli, i'll have to look at the code. i forgot the details. 06:03 eli: sid0: If you do really want one, then have a look at syntax parameters. 06:03 sid0: eli: will this work for an arbitrary expression and not just a lambda? 06:03 eli: sid0: It should, as long as you know where to place the `let' (which you need with the macro anyway). 06:04 eli: jao: If you need something along these lines, then there's code that can work better which I put in xrepl, which is why I think that it's best if you just use it. 06:05 jao: eli, fair enough. i'll see what i can do. 06:05 eli: jao: BTW, I plan on adding a few more guile-isms, IIRC, one thing that looked useful was the ",in" thing. 06:06 jao: eli, as a somehow related aside, any plans to extend help to just provide the URLs instead of directly launching a browser (as we discussed some time ago in the ML)? 06:06 sid0: eli: Yeah, seems to work fine. Thanks! Yeah, coming from CL hygienic macros are a little mind-bending 06:06 sid0: I'm really used to being able to simply replace names 06:07 eli: jao: Yeah, I still have that on my todo list... My plan was to keep `help' the same, and add a `help*' that is similar but evaluates to the url. 06:07 jao: eli, re guile-isms: that sounds great, and yet another reason to use xrepl. i'm guessing it provides a way to define my own meta-commands? (that's how it works for guile, and actually ,in was a request of mine's) 06:07 eli: (I have some of that work done and waiting on a git stash...) 06:08 jao: ah, excellent 06:08 eli: jao: There's no "published" api for adding commands -- but that's just a technicality. 06:08 eli: Since it's new, I didn't want to commit on a particular api, so I kept it out. 06:08 jao: eli, as long as there's a way, published or not, i'll be fine 06:08 eli: But the file certainly has a `defcommand' macro which I could providein some way. 06:09 eli: Yeah, there is a way... 06:09 jao: okay, expect some nagging in the not too far future then ;) 06:10 eli: jao: Sure. FWIW, the text I wrote somewhere is that you could do: 06:10 eli: (eval '(defcommand eli "stuff" "eli says" ["Make eli say stuff"] (printf "Eli says: ~a\n" (getarg 'line))) (module->namespace 'xrepl/xrepl)) 06:10 eli: and dump that in your ~/.racketrc 06:11 eli: Ugly, but intentionally so -- just in case someone really wants to extend it and can't wait for a proper api... 06:11 eli: sid0: It will help a lot to avoid that -- when you see a case where you have to do it, then ask. Chances are that you don't need it. 06:12 eli: sid0: If you want, we've recently wrote a paper on syntax parameters, which has a bunch of mid-level macro discussions about hygiene, and it might be helpful to just read through it. 06:30 sid0: eli: A link to the paper would be good in case I do need them at some point 06:39 sid0 finds http://blog.racket-lang.org/2008/02/dirty-looking-hygiene.html -- pretty cool 07:10 eli: sid0: http://barzilay.org/misc/stxparam.pdf 07:17 (quit) sid0: Ping timeout: 252 seconds 07:23 (join) jeapostrophe 07:23 (quit) jeapostrophe: Client Quit 07:48 (join) mceier 07:58 (join) dnolen 08:00 (quit) mceier: Ping timeout: 260 seconds 08:03 (join) mceier 08:10 (quit) mceier: Read error: Operation timed out 08:25 (join) mceier 08:31 (quit) dmac1: Ping timeout: 244 seconds 09:37 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/QEylyw 09:37 RacketCommitBot: [racket/master] document unexpected mouse event reporting; Closes PR 12278 - Matthias Felleisen 10:10 (quit) dnolen: Quit: dnolen 10:35 (nick) samth_away -> samth 10:44 samth: tewk: that (sending the messages back) won't work -- i'd have to change the code running in every place the program creates to do that 10:47 (quit) hkBst: Remote host closed the connection 10:47 (quit) ahinki: Quit: ChatZilla 0.9.87 [Firefox 8.0/20111006182035] 10:51 (join) anRch 10:55 (join) shofetim 11:38 (quit) tim-brown: Quit: Leaving 11:44 (quit) anRch: Quit: anRch 11:51 (join) anRch 11:53 (join) mithos28 12:11 (join) wishbone4 12:14 (nick) petey` -> petey 12:16 (quit) anRch: Quit: anRch 12:17 (join) bluezenix1 12:17 (quit) bluezenix1: Client Quit 12:18 (quit) bluezenix: Ping timeout: 252 seconds 12:20 (quit) mithos28: Quit: mithos28 12:20 (quit) Blkt: Quit: going home 12:28 (join) xharkonnen 12:52 (join) dnolen 13:44 (join) anRch 13:44 (join) jonrafkind 13:50 (quit) anRch: Ping timeout: 252 seconds 13:51 (join) anRch 13:52 (quit) masm: Ping timeout: 255 seconds 13:57 (join) masm 14:02 (join) dmac1 14:15 (join) MayDaniel 14:15 (join) bfulgham 14:16 (quit) MayDaniel: Read error: Connection reset by peer 14:31 (join) JoelMcCracken 14:55 (join) mithos28 14:57 (quit) anRch: Quit: anRch 15:12 (join) DanBurton 15:13 (quit) dnolen: Ping timeout: 252 seconds 15:32 (join) Thelas 15:33 (nick) Thelas -> Staloras 15:41 Staloras: What higher-order function should I be using to write something like this without explicit recursion? 15:41 Staloras: (define permute-real (lambda (alat) (let ((a (car alat)) (lat (cdr alat))) (cond ((null? (cdr lat)) (fill a (car lat))) (else (append (fill a (car lat)) (permute-real a (cdr lat)))))))) 15:41 Staloras: wait, that looks horrible. Here. http://codepad.org/lndJSeEd 15:43 stamourv: Staloras: Is that homework? 15:47 (quit) bfulgham: Quit: bfulgham 15:47 shofetim: Staloras: http://codepad.org/G98HRjN4 just prettier, I don't know the answer to your question 15:47 shofetim: 15:48 (quit) jao: Remote host closed the connection 15:49 JoelMcCracken: Staloras: it would be easier if you could describe what the function is supposed to do 15:51 Staloras: It is an assignment, but if I understand the policy on this correctly... well, the prof actually encouraged me to ask questions on the racket-users group if I need to, and this seems equivalent... but either way I just saw it... and I'm honestly rather embarrassed I even had to ask that. I mean, the code doesn't work now, but now it's a different issue I should be able to solve. 15:52 JoelMcCracken: (what is it suposed to do?) 15:52 DanBurton: :) sure never be afraid to ask. We just don't want to spoil the learning experience for you if it is homework 15:52 Staloras: for an unrelated question... why does the stepper show "the-cons" when it's evaluating things on lists instead of "cons" sometimes? 15:52 (join) realitygrill 15:53 Staloras: And it was a helper function for a helper function for something that finds all the permutations of a list. 15:58 Staloras: I'm probably the only person who understands (at least somewhat) the Y combinator and yet fails at simple things like this... 16:00 stamourv: Staloras: Here's a hint: There's repetition between your cond clauses. If you eliminate it, the answer may become more obvious. 16:00 stamourv: Another hint: What does this answer for the empty list? 16:01 Staloras: Like I said, I figured out that function. 16:02 Staloras: I forgot that I could use foldr to build lists. 16:02 stamourv: You did? I ust have missed that part. 16:02 stamourv: s/ust/must/ 16:03 Staloras: not your fault, I fail at clarity. I said "but either way I just saw it..." 16:06 stamourv: Oh, I see it now. 16:07 Staloras: Eww.. Okay, I have a correct answer now. 16:07 (join) jao 16:07 Staloras: So now I can ask "is there a way to make this function look less horrible"? 16:09 Staloras: http://codepad.org/MTfBZj1m 16:14 stamourv: Staloras: I recommend line breaks. 16:14 stamourv: Also, these `cons'es can be replaced with quasiquoting and unquoting, which would look nicer. 16:15 Staloras: that's the first time I've ever heard that 16:16 Staloras: people keep asking me why I use `((,a)) over (list (list a)) 16:16 stamourv: I use that all the time. 16:21 Staloras: how do I get the (cdar y) part to actually use the elements, though, instead of a list? [Read: if, say, a is 2, x is 3, and (cdar y) evaluates to 1, (cons a (cons x (cdar y)) is `(2 3 1), but `(,a ,x ,(cdar y)) is, of course, `(2 3 (1))... 16:22 stamourv: Use ,@. 16:22 stamourv: That's unquote-splicing. 16:23 (quit) JoelMcCracken: Remote host closed the connection 16:23 Staloras: Oh, thank you. That appears to work. 16:28 Staloras: Is unquote-splicing just an equivalent of `(a ,@b) = `(a . ,b)? 16:29 stamourv: rudybot: eval `(1 2 3 ,@'(4 5 6) 7) 16:29 rudybot: stamourv: your sandbox is ready 16:29 rudybot: stamourv: ; Value: (1 2 3 4 5 6 7) 16:30 stamourv: Staloras: No. 16:30 Staloras: Ah. 16:31 stamourv: `(a . ,b) is equivalent to `(a ,@b), but unquote-splicing can do more. 16:31 Staloras: Things are beginning to make sense again. 16:31 Staloras: Though every time I say that something stupid happens.. 16:32 Staloras: (by "stupid" I mean "reminding me that I really have no clue how this whole language works") 16:33 Staloras: Like say the part where I saw the Y combinator for the first time. 16:33 Staloras: Or the Y! combinator. 16:33 Staloras: Or the fact that the two aren't actually equivalent. 16:33 stamourv: Take it one bit at a time. 16:33 stamourv: Y is pretty tricky. 16:34 stamourv: And you can certainly write a lot of useful programs without ever needing it. 16:34 Staloras: I understand how those ones work NOW. (I think.) 16:35 Staloras: Just please don't use set! and call-with-current-continuation in the same program. Whenever those things are combined I can't figure out anything that's happening. 16:41 Staloras: Remind me what happens when you do that, anyways? It saves basically all the calls AROUND the call to call/cc and when you call whatever you set! equal to the continuation from call/cc it acts as though call/cc evaluated to that and goes from there? 16:41 Staloras: Is that how it works? 16:42 stamourv: Give it a try. 16:42 stamourv: rudybot: Will you give Staloras a hand? 16:42 rudybot: stamourv: LiSP is supposed to be good. I have not read it myself. However, Ikarus might be considered "state of the art" when it comes to a certain class of Scheme compiler. If you like the approach taken by Aziz and Kent Dybvig, their papers are of course, something you should examine. Also see the papers that surround the implementation of Larceny, Stalin, and PLT Scheme. 16:42 stamourv: I'll take that as a yes. 16:45 Staloras: rubybot: (define foo (lambda () (/ 1 0)))) (define bar (lambda () (+ 1 (call-with-current-continuation (lambda (baz) (set! foo baz) 1))))) (bar) (+ 3 (foo (+ 1 1))) 16:45 Staloras: well, typing the name right might help there 16:45 Staloras: rudybot: (define foo (lambda () (/ 1 0)))) (define bar (lambda () (+ 1 (call-with-current-continuation (lambda (baz) (set! foo baz) 1))))) (bar) (+ 3 (foo (+ 1 1))) 16:45 rudybot: Staloras: (begin (define k (call-with-current-continuation values)) (k k)) 16:45 stamourv: Staloras: If you give it multiple expressions, you need to tell it to eval explicitly. 16:46 stamourv: Otherwise, it will spit out something that it thinks may be vaguely related. 16:46 stamourv: rudybot: eval (define x 3) x 16:46 rudybot: stamourv: ; Value: 3 16:46 stamourv: Staloras: ^ 16:46 Staloras: rubybot: eval (define foo (lambda () (/ 1 0)))) (define bar (lambda () (+ 1 (call-with-current-continuation (lambda (baz) (set! foo baz) 1))))) (bar) (+ 3 (foo (+ 1 1))) 16:46 Staloras: ... 16:46 Staloras: rudybot: eval (define foo (lambda () (/ 1 0)))) (define bar (lambda () (+ 1 (call-with-current-continuation (lambda (baz) (set! foo baz) 1))))) (bar) (+ 3 (foo (+ 1 1))) 16:46 rudybot: Staloras: your sandbox is ready 16:46 rudybot: Staloras: error: eval:1:32: read: unexpected `)' 16:47 Staloras: rudybot: (define foo (lambda () (/ 1 0))) (define bar (lambda () (+ 1 (call-with-current-continuation (lambda (baz) (set! foo baz) 1))))) (bar) (+ 3 (foo (+ 1 1))) 16:47 rudybot: Staloras: yes, please add an alias for call-with-current-continuation (in ze Scheme Prelude/WG1/Small/ hing 1) 16:47 Staloras: rudybot: eval (define foo (lambda () (/ 1 0))) (define bar (lambda () (+ 1 (call-with-current-continuation (lambda (baz) (set! foo baz) 1))))) (bar) (+ 3 (foo (+ 1 1))) 16:47 rudybot: Staloras: ; Value: 3 16:47 Staloras: Okay, there we go. 16:47 Staloras: I'm clearly terrible at telling bots what to do. 16:47 Staloras: so... it looks like it did what I thought it would do 16:47 Staloras: probably. 16:52 Staloras: Thank you for the help, though. Hopefully I'll get to the point where I can actually not fail at these things independently. 16:53 (quit) Staloras: Quit: Page closed 17:03 (quit) DanBurton: Quit: Leaving 17:10 (quit) gf3: Excess Flood 17:12 (join) gf3 17:46 asumu: 18:01 (join) ernestas 18:04 (join) jrslepak_ 18:54 (quit) jao: Remote host closed the connection 19:16 (join) dnolen 19:33 (nick) samth -> samth_away 19:53 (quit) mceier: Quit: leaving 20:01 (join) jao 20:09 (quit) dmac1: Ping timeout: 276 seconds 20:18 (quit) wishbone4: Remote host closed the connection 20:43 (join) dmac1 20:54 (quit) jonrafkind: Ping timeout: 260 seconds 21:03 (quit) jrslepak_: Quit: This computer has gone to sleep 21:04 (join) yin 21:13 (join) jonrafkind 21:21 (quit) mithos28: Quit: mithos28 21:37 (quit) dmac1: Ping timeout: 260 seconds 21:41 (quit) yin: Quit: Leaving 21:46 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/u6jGCg 21:46 RacketCommitBot: [racket/master] add call to 'test-results' - Robby Findler 21:46 RacketCommitBot: [racket/master] swapped the backwards triangles - Robby Findler 21:53 (join) noelw 22:12 (quit) jonrafkind: Ping timeout: 245 seconds 22:31 (nick) elliottcable -> mi 22:31 (nick) mi -> elliottcable 22:40 (join) mithos28 22:48 (quit) masm: Quit: Leaving. 22:49 (join) masm 22:53 (quit) masm: Client Quit