> On Aug 18, 2017, at 5:28 AM, Sam Waxman <samwax...@gmail.com> wrote:
> 
> If I have code like this,
> 
> (define-syntax-rule (identity x)
>   x)
> 
> ((identity identity) 1)
> 
> At phase 1, the (identity identity) will get transformed into identity. As 
> macros expand outside in, however, this won't turn into (identity 1) like a 
> function would, it will try expanding the identity macro all by itself 
> without any "arguments" and give a bad syntax error.
> 
> Is there a simple way to change this so that ((identity identity) 1) actually 
> does expand into (identity 1) which expands into 1? I'm guessing not, but it 
> would certainly be a nice trick if there were.


The explanation of the error is wrong. Run it in DrRacket and see which 
identity it highlights for the error message. [I’d rather have you come up with 
a proper explanation yourself. That way you will remember.] 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to