On Tue, 20 Mar 2007, Abdulaziz Ghuloum wrote:
On Mar 19, 2007, at 11:42 AM, AndrevanTonder wrote:
Doesn't the example violate the LETREC* restriction, though?
One restriction on letrec* is very important: it must be possible to
evaluate
each <init> without assigning or referring to the value the
corresponding
<variable> or the <variable> of any of the bindings that follow it in
<bindings>.
In particular, the second time the RHS of the (define x ....) binding is
evaluated, you are actually referring (via the (cadr x) in set-y!) to the
value of x itself. So the example may already be illegal.
The program does not violate the letrec* restriction since in the second
time,
the value of x has already been determined (the first time around). The
program
never refers or assigns to any uninitialized bindings.
That is not what the letrec* restriction says. The letrec* restriction quoted
above says nothing about whether the binding is uninitialized. The <undefined>
implementation strategy is mentioned only later, where it is called
approximate.
Andre
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss