chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] using "export" with wildcard module export lis


From: Felix
Subject: [Chicken-hackers] [PATCH] using "export" with wildcard module export list
Date: Tue, 12 Jun 2012 09:50:54 +0200 (CEST)

The attached patch was contributed by "megane" and fixes a problem
when a module with "*" as export list uses the "export" form.


cheers,
felix
>From 1397abcbee61d65bc17d5b448798abdd20cb62ae Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Tue, 12 Jun 2012 09:39:29 +0200
Subject: [PATCH] update module-exist-list when doing an deferred export in a 
module with wildcard export list (contributed by 'megane')

Signed-off-by: felix <address@hidden>
---
 modules.scm            |   12 +++++++-----
 tests/module-tests.scm |   23 +++++++++++++++++++++++
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/modules.scm b/modules.scm
index fd17c62..1a4cada 100644
--- a/modules.scm
+++ b/modules.scm
@@ -157,11 +157,13 @@
          (##sys#current-module mod))))))
 
 (define (##sys#add-to-export-list mod exps)
-  (set-module-export-list! 
-   mod
-   (let ((xl (module-export-list mod)))
-     (or (eq? xl #t)           ; ==> #t
-        (append xl exps)))))
+  (let ((xl (module-export-list mod)))
+    (if (eq? xl #t)
+       (let ((el (module-exist-list mod)))
+         (set-module-exist-list!
+          mod (append el exps)))
+       (set-module-export-list!
+        mod (append xl exps)))))
 
 (define (##sys#toplevel-definition-hook sym mod exp val) #f)
 
diff --git a/tests/module-tests.scm b/tests/module-tests.scm
index 1bbacfa..ca1de1a 100644
--- a/tests/module-tests.scm
+++ b/tests/module-tests.scm
@@ -225,5 +225,28 @@
    a)
  1)
 
+;; #865 - "*" export list needs special treatment when using "export"
+;; (fix contributed by "megane")
+
+(module
+ m22
+ *
+ (import chicken scheme)
+ (define b 2))
+
+(module
+ m23
+ *
+ (import chicken scheme)
+ (import m22)
+ (export b) )
+
+(test-equal
+ "`*' export-list + explicit export"
+ (module m24 ()
+   (import m23)
+   b)
+ 2)
+
 (test-end "modules")
 
-- 
1.6.0.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]