[R6RS] modules

Matthew Flatt mflatt
Sun Aug 22 23:33:04 EDT 2004


At Fri, 20 Aug 2004 00:39:35 -0500 (EST), "R. Kent Dybvig" wrote:
>   * We need something like require-for-syntax for specifying when the
>     expressions and commands within a module are evaluated.  I propose
>     that we actually have three flavors:
> 
>       (require <spec> ...)
>       (require only-for-syntax <spec> ...)
>       (require also-for-syntax <spec> ...)
> 
>     possibly with some other syntax.

So 

 (module M (x)
   (define x 5))

 (module N ()
   (require M)
   (define-syntax f (lambda (stx) x)))

is a syntax error, because `x' has only a run-time binding, but
 
 (module N ()
   (require only-for-syntax M)
   (define-syntax f (lambda (stx) x)))

is ok because `x' has a compile-time binding. Is that right?


Also, given

  (module N (def-f-mac)
    (require M)
    (define-syntax def-f-mac
      (lambda (stx) 
        #'(define-syntax f (lambda (stx) x)))))

every use of the macro `def-f-mac' would lead to a syntax error, right?


Matthew



More information about the R6RS mailing list