From: Mark Hubbart Date: 2004-05-01T08:18:50+09:00 Subject: Re: def [](v) xx; return yy; end # returned value is ignored !? On Apr 30, 2004, at 1:54 PM, Jean-Hugues ROBERT wrote: > That makes sense. Yet, I am missing the xxx= where I do control the > value assigned to the lvalue. > I am not alone. At this point there are multiple known cases where it > would be needed for transparency: > - Reference, a reference is an indirect mean of access to a lvalue's > value that is dereferenced when the value is needed and that also > makes it possible to assign a value to the lvalue at any time. > - Lazy, a Lazy is a value that is computed when it is needed, not > before. > - Future, a Future is the returned value of an asynchronous method > call that is waited for when it is needed, not before. > - LogicVariable, a LogicVariable is a variable that can be free in > addition to being bound to some value as regular variables are. I'm not sure what the problem is... What sort of circumstance will this cause a problem? Perhaps you are thinking that assignment should do something more than it was intended to. Using your Pointer example, you could do this: p = Pointer.new() x = p[] = "hello" (p[] = "hello").inspect In line 2, would you expect something other than a simple "hello" string to be assigned to x? In line 3, would you expect #inspect to be called on p, rather than on the assigned value? You say that these are 'known cases', quite possibly I am ignorant about this, but I don't see how you couldn't have an object that computes it's value only when requested, and how assignement would be at fault. Maybe a short example of a problem-causing situation would help. --Mark