[gambit-list] more problems with blackhole

lowly coder lowlycoder at huoyanjinjing.com
Sun May 17 20:14:33 EDT 2009


In the following code, what I'm trying to understand is ...

why does the namespace seem to treat functions and macros separately? In
particular, there does not seem to be anyway for me to access 'bar' in test2
once I (export)

~/magic$ cat test.scm
(define (foo x) (list x x))
(define-macro (bar x) `(list ,x ,x))
~/magic$ cat test2.scm
(export)
(define (foo x) (list x x))
(define-macro (bar x) `(list ,x ,x))
~/magic$ bsc
> (import test)
> foo
#<procedure #2 test#foo>
> bar
*** ERROR IN ##main -- Macro name can't be used as a variable: bar
>
*** EOF again to exit
~/magic$ bsc
> (import test2)
> foo
*** ERROR IN (console)@2.1 -- Unbound variable: ~#foo
1> bar
*** ERROR IN (console)@3.1 -- Unbound variable: ~#bar
2> test2#foo
#<procedure #2 test2#foo>
2> test2#bar
*** ERROR IN (console)@5.1 -- Unbound variable: test2#bar
3>
2>
1>
>
*** EOF again to exit

i realize there are workarounds to this ... but
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090517/5c06ee5e/attachment.htm>


More information about the Gambit-list mailing list