[racket-dev] some surprising behavior with syntax-parameterize and lexical info

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Fri Apr 6 19:43:25 EDT 2012

> At the time 'def' is expanded, the lexical context of 'function-stx' does
> not include the bindings of 'args'. But then the macro produces an
> expression with that term inside a 'quote-syntax' form that is inside the
> scope of the 'args'. So by the time the expander gets to the 'quote-syntax'
> form, the lexical context of the original term has been enriched with the
> 'args' bindings.

Ah ha!  So that's where my mental model is diverging from reality.
Thank you.  For some reason, I had been thinking that the
transformer-time expression in the syntax-parameterize was somehow
impervious to the lexical enrichment process.

Posted on the dev mailing list.