Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#900 closed defect (fixed)

reexport doesn't work with `((foo bar))' style macro export declarations

Reported by: megane Owned by: felix winkelmann
Priority: major Milestone: 4.9.0
Component: compiler Version: 4.8.x
Keywords: modules Cc:
Estimated difficulty:

Description

Everything seems to work if all the modules are in the same file, but doesn't if they are compiled separately.

File: ./csi-output
-----

; loading poi.scm ...
; loading ./m2.import.scm ...
[ ... ]
; loading ./m.import.scm ...
; loading ./m2.so ...
; loading ./m.so ...

Error: unbound variable: bar

	Call history:

	<eval>	  (list)
	<eval>	  (list (cons (quote baz) (ir-macro-transformer (lambda (e i c) (quasiquote (foo))))) (quote foo) (quo......
	<eval>	  (cons (quote baz) (ir-macro-transformer (lambda (e i c) (quasiquote (foo)))))
	<eval>	  (ir-macro-transformer (lambda (e i c) (quasiquote (foo))))
	<eval>	  (list)
	<syntax>	  (##core#undefined)
	<syntax>	  (##core#undefined)
	<eval>	  (##sys#require (quote m2))
	src/m2.scm:5: ##sys#require	  
	<syntax>	  (print (baz))
	<syntax>	  (baz)
	<eval>	  (##sys#list (##core#quote foo))
	<eval>	  (##sys#list (##core#quote bar))
	<syntax>	  (bar30)
	<eval>	  (print (baz))
	<eval>	  (bar30)	<--


File: ./run.sh
-----

set -ex
rm -f *.so *.import.scm *.o poi
csc -J -s src/m.scm
mv src/*.so .
csc -I . -J -s src/m2.scm
mv src/*.so .
csc poi.scm
./poi



File: ./poi.scm
-----

(use m2)
(print (baz))




File: ./output
-----

+ rm -f m2.so m.so m2.import.scm m.import.scm '*.o' poi
+ csc -J -s src/m.scm
+ mv src/m.so .
+ csc -I . -J -s src/m2.scm
+ mv src/m2.so .
+ csc poi.scm
+ ./poi

Error: unbound variable: bar

	Call history:

	poi.scm:1: ##sys#require	  
	src/m2.scm:5: ##sys#require	  
	poi.scm:2: bar	  	<--




File: ./src/m.scm
-----

(module
 m
 ((foo bar))		    ; changing this to (foo bar) makes it work
 (import chicken scheme)
 (define (bar) 1)
 (define-syntax foo
   (ir-macro-transformer
    (lambda (e i c)
      `(bar)))))



File: ./src/m2.scm
-----

(module
 m2
 (baz)
 (import chicken scheme)
 (use m)
 (reexport m)
 ;; uncommenting these does not seem to make big difference
 ;; (import-for-syntax m)
 ;; (begin-for-syntax (require-library m))
 (define-syntax baz
   (ir-macro-transformer
    (lambda (e i c)
      `(foo)))))

Attachments (1)

reexport-bug.tar (10.0 KB) - added by megane 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by megane

Attachment: reexport-bug.tar added

comment:1 Changed 12 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newassigned

comment:2 Changed 12 years ago by felix winkelmann

Resolution: fixed
Status: assignedclosed

comment:3 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.