~ chicken-core (chicken-5) 1761ef4bb49e9fa07c26bc639760040ed3824646
commit 1761ef4bb49e9fa07c26bc639760040ed3824646 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sat Dec 11 13:48:30 2010 +0100 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Sat Dec 11 13:48:30 2010 +0100 strip-syntax bugfix by sjamaan diff --git a/expand.scm b/expand.scm index 9d9123b4..443c1c43 100644 --- a/expand.scm +++ b/expand.scm @@ -94,6 +94,7 @@ (lookup x se) (getp x '##core#macro-alias) ) ) ) (cond ((getp x '##core#real-name)) + ((getp x '##core#primitive)) ((and alias (not (assq x se))) (##sys#alias-global-hook x #f #f)) ((not x2) x) diff --git a/tests/compiler-tests.scm b/tests/compiler-tests.scm index f402f75d..43e308e1 100644 --- a/tests/compiler-tests.scm +++ b/tests/compiler-tests.scm @@ -99,6 +99,32 @@ (strlen-safe-macro* "hello, world") (strlen-primitive-macro "hello, world")) +;; Type specifiers and variable names in foreign-lambda in macros +;; are incorrectly renamed in modules, too. +(foreign-declare "void foo(void *abc) { printf(\"hi\\n\"); }") + +(module foo () + (import chicken scheme foreign) ; "chicken" includes an export for "void" + + (let-syntax ((fl + (syntax-rules () + ((_) + (foreign-lambda void foo (c-pointer void))))) + (fl* + (syntax-rules () + ((_) + (foreign-lambda* void (((c-pointer void) a)) + "C_return(a);")))) + (fp + (syntax-rules () + ((_) + (foreign-primitive void (((c-pointer void) a)) + "C_return(a);"))))) + (fl) + (fl*) + (fp))) + + ;;; compiler-syntax for map/for-each must be careful when the ; operator may have side-effects (currently only lambda exprs and symbols ; are allowed) @@ -142,4 +168,4 @@ (define (baz) (bar a: #t)) baz) - bar) + bar) \ No newline at end of fileTrap