Re: [racket] Macro example in Racket Guide

2012-06-04 Thread Jon Rafkind
On 06/04/2012 09:50 PM, Jon Rafkind wrote: > On 06/04/2012 09:48 PM, Eli Barzilay wrote: >> A few minutes ago, Jon Rafkind wrote: >>> Also that example is somewhat bizarre.. I think the (clock a ...) >>> template should be (get-clock) instead of ((get-clock) a ...), >>> right? >> No -- with that ch

Re: [racket] Macro example in Racket Guide

2012-06-04 Thread Jon Rafkind
On 06/04/2012 09:48 PM, Eli Barzilay wrote: > A few minutes ago, Jon Rafkind wrote: >> Also that example is somewhat bizarre.. I think the (clock a ...) >> template should be (get-clock) instead of ((get-clock) a ...), >> right? > No -- with that change you get a weird identifier macro where > >

Re: [racket] Macro example in Racket Guide

2012-06-04 Thread Eli Barzilay
A few minutes ago, Jon Rafkind wrote: > > Also that example is somewhat bizarre.. I think the (clock a ...) > template should be (get-clock) instead of ((get-clock) a ...), > right? No -- with that change you get a weird identifier macro where clock evaluates to (for example) 0, and (clock

Re: [racket] Macro example in Racket Guide

2012-06-04 Thread Eli Barzilay
10 minutes ago, Harry Spier wrote: > [...] > If I now remove the line in the macro " [(clock a ...) ((get-clock) > a ...)]" then entering:either clock or (clock) at the evaluation > prompt returns 0. Why is it that (clock) doesn't still fail with > "procedure application: expected procedure, give

Re: [racket] Macro example in Racket Guide

2012-06-04 Thread Jon Rafkind
I think its because without the (clock a ...) pattern the input (clock) is matched to the pattern 'clock' which matches by default. The pattern for just a lone identifier should be (in terms of syntax/parse) 'clock:identifier'. The docs for make-set!-transformer suggest to use a fender expressio