At Thu, 21 May 2015 22:58:04 -0400, Josh Grams wrote:
> Also, shouldn't the x's under syntax-rules and in the expansion of
> (m) have a 'b' in their scope sets (since they're in the
> syntax-rules scope)? Or aren't they?

The `let-syntax` form binds only in its body, not the right-hand sides
of bindings, so that's why there's no `b` on those `x`s.

If the example used `letrec-syntax` instead of `let-syntax`, then `b`
would go on those `x`s.


> - I found the use-site scope argument a little confusing. I got
>   it, but it took a while. Labelling the scopes better would
>   probably help. But also...I think this probem can occur if you
>   invoke the macro from any scope which contains the macro
>   definition? There should be some way to make that clear: the
>   use-site needs a scope added to ensure that *references* to
>   macro arguments are never treated as lexical ancestors, but
>   *definitions* of names passed in can (and should) be.

I'm not sure I follow your question, but I think you're referring to
the optimization described in the inset note at the end of the section.

If a macro is used in a context that already has additional scopes
relative to the macro's defining scope, then those additional scopes
can serve the same role as a use-site scope. That is, the use-site
scope would appear on exactly the identifiers that have the additional
scopes, so a use-site scope would be redundant.

As far as the presentation goes, I doubt that the current position of
that note is the right place to discuss the optimization, anyway.


Thanks for your other comments!

-- 
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