fix macros that expand into (begin (define-module ...) ...)
authorAndy Wingo <wingo@pobox.com>
Thu, 6 May 2010 20:34:36 +0000 (22:34 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 6 May 2010 20:42:44 +0000 (22:42 +0200)
* module/ice-9/boot-9.scm (define-module): Add `expand' to the
  situations, so that we ensure the current module changes at expand
  time.

* module/ice-9/r6rs-libraries.scm (library): Expand the body within @@
  expressions.

module/ice-9/boot-9.scm
module/ice-9/r6rs-libraries.scm

index c1a9447..794e929 100644 (file)
@@ -3326,7 +3326,7 @@ module '(ice-9 q) '(make-q q-length))}."
     (syntax-case x ()
       ((_ (name name* ...) arg ...)
        (with-syntax (((quoted-arg ...) (quotify #'(arg ...))))
-         #'(eval-when (eval load compile)
+         #'(eval-when (eval load compile expand)
              (let ((m (process-define-module
                        (list '(name name* ...) quoted-arg ...))))
                (set-current-module m)
index dc77ee6..14c89d0 100644 (file)
                  ...
                  (re-export r ...)
                  (export e ...)
-                 body ...))))))))
+                 (@@ (name name* ...) body)
+                 ...))))))))
     
 (define-syntax import
   (lambda (stx)