[R6RS] Internal DEFINE vs. macros

Michael Sperber sperber
Fri Apr 15 10:23:02 EDT 2005


dyb at cs.indiana.edu writes:

> (let-syntax ((foo (syntax-rules ()
> 		    ((foo ?x) (define ?x 'outer)))))
>   (let ()
>     (define-syntax foo
>       (syntax-rules ()
> 	((foo) (define ?x 'inner))))
>     (foo a)
>     a))
>
>> produces outer on PLT, but on Chez says:
>>
>> Error: invalid syntax (foo a).
>>
>> Why?  (If you think I should wait until the full description of
>> SYNTAX-CASE is out let me know.)
>
> Chez Scheme processes body forms from left to right and adds macro
> definitions to the compile-time environment as it proceeds. [...]

I'm probably being dense---why doesn't the definition of FOO get
applied to the use then?  Why is this an error?

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla


More information about the R6RS mailing list