Michael Sperber [Mr. Preprocessor] writes:
> >>>>> "Brian" == Brian D Carlstrom <firstname.lastname@example.org> writes:
> Brian> define-syntax does not have to be used with syntax-rules. You can
> Brian> provide a functon to do explicit s-exp based conversion.
> Brian> I tried to find a simple example but...
> There's documumentation at
> which applies to Scheme 48/scsh as well, with the exception of the
> TRANSFORMER keywords, which is omitted here.
There are three simple examples in scsh-0.6.1/scheme/misc/doodl.scm
(the macros SETTER, DEFINE-SETTER, and BIND). Basically, you rename
rather than gensym, and compare names with the dedicated comparison
function rather than with Scheme's EQ? or something.
;; transforms EXP --> EXP'
(lambda (exp rename eq?) ...))
[ What I called names may be symbols but also ``generated names''
depending on the context of the macro call (FOO X ...). If you
do not compare names in the way you should your macro FOO may
break when called from within the (intermediate) expansion
of another macro call like (BAR X) with
(syntax-rules () ((bar ?x ...) (* * * (foo ?x ...) * * *))))