[gambit-list] macro/function interaction

symbolic expression symbolic.expression at gmail.com
Sat Jan 24 21:42:17 EST 2009

(define (foo x) (+ x 1))
(define-macro (bar x) (foo x))
(bar 10)

this baffles me, if I open up gsi and paste this into the interpreter, I get
however, if I stuff this in test.scm and run "gsi test.scm" I get:

*** ERROR IN #<procedure #2>, "test.scm"@2.24 -- Unbound variable: foo

what's going on? how do I fix this?

[I would prefer that code in "gsi test.scm" has the same effect as if I type
it into the interpreter]

thanks in advance!

-- symbolic expression
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090124/1bde5c5e/attachment.htm>

More information about the Gambit-list mailing list