From d9b1c71ac61b9e510ff0e2ce819e4002348eceb6 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 6 May 2010 22:34:36 +0200 Subject: [PATCH] fix macros that expand into (begin (define-module ...) ...) * 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 | 2 +- module/ice-9/r6rs-libraries.scm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index c1a944763..794e92999 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -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) diff --git a/module/ice-9/r6rs-libraries.scm b/module/ice-9/r6rs-libraries.scm index dc77ee695..14c89d01e 100644 --- a/module/ice-9/r6rs-libraries.scm +++ b/module/ice-9/r6rs-libraries.scm @@ -178,7 +178,8 @@ ... (re-export r ...) (export e ...) - body ...)))))))) + (@@ (name name* ...) body) + ...)))))))) (define-syntax import (lambda (stx)