~ chicken-core (chicken-5) 1e2546c1ee895e0809dc1900b485506470264865
commit 1e2546c1ee895e0809dc1900b485506470264865
Author: Peter Bex <peter.bex@xs4all.nl>
AuthorDate: Sat Mar 5 20:08:06 2011 +0100
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Sun Mar 6 12:55:21 2011 +0100
Fix #519 by putting a ##core#real-name onto module-exported symbols
diff --git a/expand.scm b/expand.scm
index 4424e084..8efd4460 100644
--- a/expand.scm
+++ b/expand.scm
@@ -269,11 +269,12 @@
(define ##sys#enable-runtime-macros #f)
(define (##sys#module-rename sym prefix)
- (##sys#string->symbol
- (string-append
- (##sys#slot prefix 1)
- "#"
- (##sys#slot sym 1) ) ) )
+ (let ((qualified-symbol (##sys#string->symbol (string-append
+ (##sys#slot prefix 1)
+ "#"
+ (##sys#slot sym 1) ) )))
+ (putp qualified-symbol '##core#real-name sym)
+ qualified-symbol) )
(define (##sys#alias-global-hook sym assign where)
(define (mrename sym)
diff --git a/tests/syntax-tests.scm b/tests/syntax-tests.scm
index 16878b23..3d151ee2 100644
--- a/tests/syntax-tests.scm
+++ b/tests/syntax-tests.scm
@@ -196,6 +196,22 @@
(bar foo))))
)
+;;; strip-syntax on renamed module identifiers, as well as core identifiers
+(module foo (bar)
+ (import chicken scheme)
+
+ (define bar 1))
+
+(import foo)
+
+(define-syntax baz
+ (er-macro-transformer
+ (lambda (e r c)
+ `',(strip-syntax (r 'bar)))))
+
+(t 'bar (baz bar))
+(t 'bar (baz void))
+
;;; alternative ellipsis test (SRFI-46)
(define-syntax foo
Trap