Discussion:
[Larceny-users] visibility of bindings inside macros
Jon Wells
2008-08-02 07:29:19 UTC
Permalink
I don't know if this is a generic scheme question or a larceny
question...

What is it that makes definitions for standard parts of the language
visible at XXX below and it be illegal to refer to a definition of one's
own creation?

(import (rnrs))

(define-syntax blarg
(lambda (form)

;; XXX

(syntax-case form ()
((_ crud ...)
:

No need to expound on "that's what the standard says" if that's the
case.

jon.
AndrevanTonder
2008-08-02 10:36:14 UTC
Permalink
Post by Jon Wells
What is it that makes definitions for standard parts of the language
visible at XXX below and it be illegal to refer to a definition of one's
own creation?
(import (rnrs))
(define-syntax blarg
(lambda (form)
;; XXX
(syntax-case form ()
((_ crud ...)
Since XXX is executed at macro expansion time, you can refer to definitions of
your own creation in XXX as long as you wrap them in a library that you then
import "for expand" - see the r6rs documentation for the syntax. You
do not have to do that for (rnrs) because everything in
(rnrs) is exported for both runtime and expansion time by default.

Andre

Loading...