Hi,

> It is correct, but I kinda liked the explicit mention of pattern
> variable environments in the original.  In syntax expansion, there are
> lexical variables, bound in lexical environments, and pattern variables,
> bound in syntax-expansion environments.  The confusion addressed by that
> paragraph was to treat a lexical variable as a pattern variable.
...
> Do you still think the discussion of environments is distracting?
> Documentation should ulitimately be for users, and if the original text
> is not useful at all, by all means we should change it.

Not distracting, it's just that I didn't understand it immediately
because it didn't explicitly say that I was defining variables in two
different sorts of environments - just that there were two different
sorts of environments. How about this language?

The reason that this one doesn't work is that there are really two
environments at work here -- the environment of pattern variables, as
bound by @code{syntax-case}, and the environment of lexical variables,
as bound by normal Scheme. The outer let form establishes a binding in
the environment of lexical variables, but the inner let form is inside
a syntax form, where only pattern variables will be substituted. Here
we need to introduce a piece of the lexical environment into the
pattern variable environment, and we can do so using
@code{syntax-case} itself:

Noah

Reply via email to