The attached patch (also contributed by "megane") fixes a problem with "reexport" and modules that use "*" as export list.
cheers, felix
>From 0bceb5b69779458eb3d0439cb05ab57af4b5e4cc Mon Sep 17 00:00:00 2001 From: felix <[email protected]> Date: Tue, 12 Jun 2012 09:46:35 +0200 Subject: [PATCH] reexport must update module-exist-list for modules having wildcard export list (contributed by megane) Signed-off-by: felix <[email protected]> --- modules.scm | 22 +++++++++++++++------- tests/module-tests.scm | 29 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/modules.scm b/modules.scm index fd17c62..c26e4f7 100644 --- a/modules.scm +++ b/modules.scm @@ -694,13 +694,21 @@ (when reexp? (unless cm (##sys#syntax-error-hook loc "`reexport' only valid inside a module")) - (set-module-export-list! - cm - (append - (let ((xl (module-export-list cm) )) - (if (eq? #t xl) '() xl)) - (map car vsv) - (map car vss))) + + (if (eq? #t (module-export-list cm)) + (begin + (set-module-exist-list! + cm + (append (module-exist-list cm) + (map car vsv) + (map car vss)))) + (set-module-export-list! + cm + (append + (let ((xl (module-export-list cm) )) + (if (eq? #t xl) '() xl)) + (map car vsv) + (map car vss)))) (when (pair? prims) (set-module-meta-expressions! cm diff --git a/tests/module-tests.scm b/tests/module-tests.scm index 1bbacfa..a392ec2 100644 --- a/tests/module-tests.scm +++ b/tests/module-tests.scm @@ -225,5 +225,34 @@ a) 1) +;; #843 - "reexport" must update module-exist-list in module with wildcard exports +;; (contributed by "megane") + +(module m25 * + (import chicken scheme) + (define foo 1)) + +(module m26 (bar) + (import chicken scheme) + (reexport m25) + (define bar 2)) + +(module m27 * + (import chicken scheme) + (reexport m25) ;; <- oops, bar not exported anymore + (define bar 2)) + +(test-equal + "handle star-exporting module with reexport" + (module m28 () + (import scheme chicken) + (import (prefix m26 b/)) + (import (prefix m27 c/)) + (print b/foo) + (print c/foo) + (print b/bar) + c/bar) ;; <- Error: unbound variable: c/bar + 2) + (test-end "modules") -- 1.6.0.4
_______________________________________________ Chicken-hackers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-hackers
