[r6rs-discuss] Expansion process
AndrevanTonder
andre at het.brown.edu
Thu Feb 22 17:59:08 EST 2007
On Thu, 22 Feb 2007, Per Bothner wrote:
> (define VAR (MAC))
> (set! VAR (MAC))
> (list (MAC))
> (MAC)
> (define-syntax MAC ...)
>
> The first 3 (MAC) applications are deferred, so are correctly
> done using the following the define-syntax.
>
> The 4th (MAC) is not deferred, and so "the wrong thing will
> happen".
Not in a correct implementation. A correct implementation should throw a syntax
error. See section 8:
"A definition in the sequence of forms must not define any identifier whose
binding is used to determine the meaning of the undeferred portions of the
definition or any definition that precedes it in the sequence of forms."
and further down:
"The implementation should treat a violation of the restriction as a syntax
violation."
Andre
More information about the r6rs-discuss
mailing list