Hi,

I am trying to reexport functions out of my own modules - but am
failing.

In my simple example I have 3 modules:

  - mod-a: exports a simple function
  - mod-b: does nothing except reexporting the simple function
  - mod-c: imports mod-b and calls the simple function

The behaviour in chicken-4 and chicken-5 are the same - when I pack all
3 modules in the same file the whole thing works (in Chicken-4 mod-c has
to "import" mod-b rather than just "use" it).

Splitting the whole thing into 3 files does not work - I get a runtime
exception (when executing "mod-c"): "Error: unbound variable:
mod-a#test-a".

Does the modules have to be eggs to be able to reexport?

lg
Martin

The attached files are for chicken-5



(module mod-a (test-a)
	(import scheme chicken)
	
	(define test-a (lambda ()
		(print "test")))
)

(module mod-b ()
	(import scheme chicken)
	(reexport (only mod-a test-a)))
	
(module mod-c ()
	(import scheme chicken mod-b)
	
	(test-a))

Attachment: compile.sh
Description: application/shellscript

(module mod-a
	(
		test-a
	)
	(import scheme chicken)
	
	(define test-a (lambda ()
		(print "test")
	))
)
(module mod-b 
	(
	)
	(import scheme chicken)
	(reexport (only mod-a test-a))
)
(module mod-c ()
	(import scheme chicken mod-b)
	
	(test-a)
)
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to