From: Lynn Winebarger <owinebar@free-expression.org>
Cc: Marius Vollmer <mvo@zagadka.ping.de>,
Guile Development List <guile-devel@gnu.org>
Subject: Re: Syntax checks
Date: Sat, 13 Apr 2002 13:28:26 -0500 [thread overview]
Message-ID: <02041313282601.10649@locke.free-expression.org> (raw)
In-Reply-To: <m3ads7u5la.fsf@laruns.ossau.uklinux.net>
On Saturday 13 April 2002 07:48, Neil Jerram wrote:
> I broadly agree with your argument, but have just one question. Does
> this last point mean that macro definitions will only work if they are
> placed _before_ any expressions that use them?
Yes.
> Or am I missing something cleverer here?
Not that I know of. The productions of macro definitions don't get
expanded until the macro is applied so recursive use is fine. Those
productions should (lexically) scope to wherever the macro was defined
(like a module) so that the problem of exporting extra syntax can be
avoided. In some sense this should 'obvious' as macros are just lambdas
and they scope lexically, on the other hand it's not since macros just produce
new code and the evaluator isn't itself scoped to the lexical environment of
the macro. What's the correct evaluation of
(define-syntax foo (syntax-rules () ((_) (bar))))
(define-syntax bar (syntax-rules () ((_) 1)))
(let-syntax ((bar (syntax-rules () ((_) 2))))
(foo))
I'd say it should be 1, even though (foo) produces (bar) in an environment
with a new binding for bar. It should work the same way for modules.
Lynn
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-04-13 18:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-06 6:25 Syntax checks Dirk Herrmann
2002-04-06 15:38 ` Neil Jerram
2002-04-07 7:09 ` Dirk Herrmann
2002-04-08 18:27 ` Neil Jerram
2002-04-07 10:40 ` Marius Vollmer
2002-04-09 20:48 ` Lynn Winebarger
2002-04-13 9:01 ` Dirk Herrmann
2002-04-13 12:48 ` Neil Jerram
2002-04-13 18:28 ` Lynn Winebarger [this message]
2002-04-13 18:10 ` Lynn Winebarger
2002-04-14 18:18 ` Marius Vollmer
2002-04-14 18:11 ` Marius Vollmer
2002-04-23 21:55 ` Thien-Thi Nguyen
2002-04-14 17:52 ` Marius Vollmer
2002-04-29 23:55 ` Lynn Winebarger
2002-05-07 19:24 ` Marius Vollmer
2002-05-09 5:59 ` Lynn Winebarger
2002-04-07 10:05 ` Marius Vollmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02041313282601.10649@locke.free-expression.org \
--to=owinebar@free-expression.org \
--cc=guile-devel@gnu.org \
--cc=mvo@zagadka.ping.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).