Opened 9 years ago

Closed 9 years ago

Last modified 8 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:


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 ./ ...
; loading ./ ...

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: ./

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

File: ./poi.scm

(use m2)
(print (baz))

File: ./output

+ rm -f m2.import.scm m.import.scm '*.o' poi
+ csc -J -s src/m.scm
+ mv src/ .
+ csc -I . -J -s src/m2.scm
+ mv src/ .
+ 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

 ((foo bar))		    ; changing this to (foo bar) makes it work
 (import chicken scheme)
 (define (bar) 1)
 (define-syntax foo
    (lambda (e i c)

File: ./src/m2.scm

 (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
    (lambda (e i c)

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by megane

Attachment: reexport-bug.tar added

comment:1 Changed 9 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newassigned

comment:2 Changed 9 years ago by felix winkelmann

Resolution: fixed
Status: assignedclosed

comment:3 Changed 8 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.