[r6rs-discuss] Expansion process
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
Received on Thu Feb 22 2007 - 17:59:08 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC