[plt-scheme] Letrect (was blah. units)
On Mon, 28 Oct 2002, Jerzy Karczmarczuk wrote:
> Guess what is (say, in DrScheme) the value of (cadr y) where
> (define y
> (letrec ((x (cons 1 x)) x)
> )
This waits, because one closing paren is missing. Yes, I would expect
this ;-)
After adding it, you get what you pay for. Scheme is not lazy, so there
is no appropriate behaviour here. One cannot signal unbound
variable error here, because x is bound. There is some
discussion of this in SICP in connection with internal DEFINEs.
> Yes, you guessed it right. Are you happy with it? I am not. But my
> personal philosophy was rather coherent than valuable...
Probably nobody is, but there is no visible solution right now.
If you introduce laziness here, you would get problems with
assignments (or its newer verision known as object-oriented
programming).
Best regards,
Zbyszek Jurkiewicz