[R6RS] modules

R. Kent Dybvig dyb
Mon Aug 23 01:44:31 EDT 2004


> 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?

Yes.

> 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?

Right.

Kent


More information about the R6RS mailing list