[gambit-list] macro/function interaction

Bill Six billsix at gmail.com
Sat Jan 24 22:37:27 EST 2009


Hi,

These links should help:

https://webmail.iro.umontreal.ca/pipermail/gambit-list/2006-May/000690.html
https://webmail.iro.umontreal.ca/pipermail/gambit-list/2006-May/000692.html

Bill

On Sat, Jan 24, 2009 at 2:42 PM, symbolic expression <
symbolic.expression at gmail.com> wrote:

> (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 11
> 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
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090124/ebdf0951/attachment.htm>


More information about the Gambit-list mailing list