Macros and compilation
Jocelyn Paine
popx@ifs.org.uk
Fri Dec 20 10:36:00 GMT 2002
This is about macros from a compiled module not being recognised in
another compiled module. I define macros m1 and m2 in a module called
'test:
(module-name 'test)
(module-static #t)
(define-syntax m1
(syntax-rules ()
((m1 E)
(m2 E)
)
)
)
(define-syntax m2
(syntax-rules ()
((m2 E)
(format "Called m2 ~s" E)
)
)
)
Then I use them in module 'test2, which requires 'test:
(module-name 'test2)
(module-static #t)
(require <kb7.mm3.general.test>)
(define (test-m1 x)
(m1 x)
)
(define (test-m2 x)
(m2 x)
)
Then load the compiled version of 'test2 and call a procedure that
is indirectly defined in terms of m2:
#|kawa:1|# (require <kb7.mm3.general.test2>)
#<procedure kb7.mm3.general.test2>
#|kawa:2|# (test-m1 'a)
gnu.mapping.UnboundSymbol: Unbound symbol m1
So how (if at all) can I get compilation to recognise that m2 as well as
m1 is to be expanded? The reply to a posting Marco Vezzoli made on 23 Aug
2000 suggests I need to export the macros: is that so?
Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091
More information about the Kawa
mailing list