From: Martin DeMello Date: 2003-12-29T17:56:48+09:00 Subject: Re: Inconsistent value of uninitialized variable Nathaniel Talbott wrote: > On Dec 28, 2003, at 23:11, Martin DeMello wrote: > > > Nathaniel Talbott wrote: > >> Isn't it this behavior that makes it possible to define a recursive > >> block? > >> > >> y = 0 > >> x = proc{y += 1; x.call unless(y == 100); y} > >> p x.call > >> > >> I suppose you could require a prior assignment to x in this case, but > >> that starts to smell like having to declare variables... > > > > This is not a proper recursive block - for instance > > > > y = 0 > > x = proc{y += 1; x.call unless(y == 100); y} > > z = x > > x = nil > > z.call > > "Not proper" might be strong language, but yes, it could definitely be Sorry. Actually, you're right - this'll cover nearly every case in which you'd want the construct, but relying on a variable name makes me twitchy. > broken. Do you have a better construct for a recursive block? No, I remember fighting over it once, but I didn't get anywhere. I'd like to see some equivalent to letrec in 2.0, personally. martin