unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Possible Documentation Fix
@ 2011-01-29 18:08 Noah Lavine
  2011-01-30 12:27 ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Noah Lavine @ 2011-01-29 18:08 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

Hello all,

I was recently reading the syntax-case documentation (as part of my
project to make peg.scm use syntax-case), and I hit a paragraph that I
found difficult to understand. I think I figured out what it means.
The attached patch changes the paragraph to something that I think
would have been more clear to me on my first time reading it.

Could someone who understands syntax-case better than I do please
review it for correctness?

Thanks,
Noah

[-- Attachment #2: 0001-doc-ref-api-macros.texi-make-the-explanation-of-datu.patch --]
[-- Type: application/octet-stream, Size: 1378 bytes --]

From a93988c5f2f2138bd0765273aa7da6b9e567df59 Mon Sep 17 00:00:00 2001
From: Noah Lavine <nlavine@haverford.edu>
Date: Sat, 29 Jan 2011 13:04:55 -0500
Subject: [PATCH]  * doc/ref/api-macros.texi: make the explanation of datum->syntax in
     the syntax-case documentation a bit more clear.

---
 doc/ref/api-macros.texi |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/doc/ref/api-macros.texi b/doc/ref/api-macros.texi
index 1fbfa24..c96670c 100644
--- a/doc/ref/api-macros.texi
+++ b/doc/ref/api-macros.texi
@@ -574,11 +574,10 @@ Here's another solution that doesn't work:
              (if it then else)))))))
 @end example
 
-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. Here we need to introduce a piece of Scheme's environment into that of
-the syntax expander, and we can do so using @code{syntax-case} itself:
+The reason this doesn't work is that the binding of @code{'it} established in
+the outer let form is not substituted into the definition of @code{'it} in the
+inner let form, inside the @code{syntax} form. One way to make this
+substitution happen is to use @code{syntax-case} itself:
 
 @example
 ;; works, but is obtuse
-- 
1.7.3.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-02 20:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-29 18:08 [PATCH] Possible Documentation Fix Noah Lavine
2011-01-30 12:27 ` Andy Wingo
2011-01-31 19:54   ` Noah Lavine
2011-01-31 20:39     ` Andy Wingo
2011-02-02 14:53       ` Noah Lavine
2011-02-02 19:54         ` Andy Wingo
2011-02-02 20:09           ` Noah Lavine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).