[R6RS] define-syntax vs. core/library split

Michael Sperber sperber at informatik.uni-tuebingen.de
Wed May 10 11:52:34 EDT 2006

I have a few nitpick questions regarding the interaction between
`define-syntax' and the core/library split as currently proposed.  The
core/library document says that `syntax-rules' and `syntax-case' are
separate libraries, both exporting `define-syntax'.  Maybe I haven't
found the right bits of information yet in the split document and the
syntax-case proposal.

Is the `define-syntax' in the `syntax-rules' library the same as
that in the `syntax-case' library?  I.e., if I do

(import (r6rs syntax-rules)
        (except (r6rs syntax-case)
                define-syntax let-syntax letrec-syntax syntax-rules))

can I do:

(define-syntax foo (syntax-case ...))


I suspect this would be the wrong way to use these libraries anyway,
as the RHS is evaluated in the expansion phase, and therefore the
`syntax-rules' macro would need to be imported (for ... expand).  As
`define-syntax' itself would beed to be imported into the run-time
phase, this suggests that `define-syntax', `let-syntax' and
`letrec-syntax' should probably be moved into the core, and that the
`syntax-rules' and `syntax-case' libraries should only export
`syntax-rules' and `syntax-case' respectively.  So you see I'm pretty
confused, and I'd really appreciate if somebody could help me figure
it out.

(I'm also asking because, in Scheme 48, the environment of the RHS is
special, and actually part of an infinite syntactic tower.  This would
make a `define-syntax' allowing only `syntax-rules' incompatible with
one allowing only `syntax-case', say.)

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

More information about the R6RS mailing list