Subject: Re: define-syntax problem...
From: (Rob Warnock)
Date: 1997/03/23
Newsgroups: comp.lang.scheme
Message-ID: <5h22oj$>

Per Bothner <> wrote:
| I realize that Kawa needs a low-level syntax machanism in addition
| to define-syntax.  Unfortunately, there seems to be little
| commonality here between Scheem implementations.
| SLib seems to require defmacro, so perhaps I should start by
| implementing that.

Good! Despite the discipline needed to write macros that work reliably
with defmacro, personally I find that the defmacro style is more
"intuitive" to me [but lets *not* re-open *that* issue again!] than
define-syntax + syntax-rules. Besides, it's what CL has, so I can
use the same style when moving back & forth between Scheme & CL.

As a result, the first thing I look for in any new Scheme I get my 
hands on is how to get "defmacro" working. E.g., SCM comes with it 
(well, in its "Init" file); it can be trivially defined using MzScheme's
low-level "define-macro" facility; etc.


p.s. For those of used to working with olden assemblers that had "real"
macros systems (e.g, TOPS-10, to name one of the best), managing variable
capture in defmacro comes naturally. (You do it when you want to, e.g.,
macros like "dolist" which deliberately extend the environment with a
captured name; and avoid it with gensym when you don't.) If one lacks such
experience, a careful reading of Graham's book "On Lisp" should help a lot...

Rob Warnock, 7L-551
Silicon Graphics, Inc.
2011 N. Shoreline Blvd.		Phone: 415-933-1673  FAX: 415-933-0979
Mountain View, CA  94043	PP-ASEL-IA