mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
macro documentation fixup
* doc/ref/api-macros.texi: make the difference between pattern variables and lexical variables a bit clearer.
This commit is contained in:
parent
71d0152e66
commit
09cb3ae237
1 changed files with 8 additions and 5 deletions
|
@ -574,11 +574,14 @@ Here's another solution that doesn't work:
|
||||||
(if it then else)))))))
|
(if it then else)))))))
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The reason that this one doesn't work is that there are really two environments
|
The reason that this one doesn't work is that there are really two
|
||||||
at work here -- the environment of pattern variables, as bound by
|
environments at work here -- the environment of pattern variables, as
|
||||||
@code{syntax-case}, and the environment of lexical variables, as bound by normal
|
bound by @code{syntax-case}, and the environment of lexical variables,
|
||||||
Scheme. Here we need to introduce a piece of Scheme's environment into that of
|
as bound by normal Scheme. The outer let form establishes a binding in
|
||||||
the syntax expander, and we can do so using @code{syntax-case} itself:
|
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:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
;; works, but is obtuse
|
;; works, but is obtuse
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue