Welcome to the CHICKEN Scheme pasting service

module fail pasted by megane on Sun Jun 10 20:04:09 2012

;; Works
(module
 bar
 *
 (import chicken scheme)
 (define b 2))

(module
 foo
 ()
 (import chicken scheme)
 (import bar)
 (export b)
 (export a)
 (define a 1)
 
 )
(import foo)
(print a)
(print b)

;; Doesn't work
(module
 bar2
 *
 (import chicken scheme)
 (define b2 2))

(module
 foo2
 *
 (import chicken scheme)
 (export b2)
 (import bar2)
 (export a2)
 (define a2 1)
 
 )

(import foo2)
(print a2)
(print b2) ;; <- Error: unbound variable: b2

maybefix added by megane on Sun Jun 10 20:06:39 2012

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)
 

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the result of `(and #t (or 'damn 'you 'spammers))'?
Visually impaired? Let me spell it for you (wav file) download WAV