[racket] Macro example in Racket Guide

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Mon Jun 4 23:52:36 EDT 2012

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 change you get a weird identifier macro where
>>
>>   clock
>>
>> evaluates to (for example) 0, and
>>
>>   (clock 1 2 3)
>>
>> evaluates to 0 too.  Using ((get-clock) a ...) makes the latter throw
>> an error which makes it behave uniformly.
>>
> Well whats bizarre about it is (clock 1 2 3) should really be a syntax error, but its converted into a runtime error instead.

Ok nevermind.. since clock can be used in any expression position there is nothing special about the first position in an s-expression so its exactly like doing (0 1 2 3)..

Posted on the users mailing list.