From: Ryan Williams Date: 2006-12-13T06:38:06+09:00 Subject: Re: Assignment method strangeness ------=_Part_156762_1736160.1165959481752 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline > > As you can see in the first one.. even a single value passed to an > assignment is parsed as an array. If you need multiple arguments to an > assignment, you have to handle them inside the method body itself. > > You are correct. That's pretty useful, though you still can't pass in blocks. The reason I was interested in this was that I wanted to create some attributes that could be assigned either a literal value, or a block that returned the literal value when called. Then you could do some really lazy evaluation, as in: test.a = { long_computation } .... ...in another scope... .... test.a # returns result of computation Or you could use it to keep some objects in sync: test.a = { some_other_object.b } some_other_object.b = 42 test.a = 42 I guess the best route to this is either a new assignment-like method ( test.set_a) or test.a = Proc.new. -RYaN ------=_Part_156762_1736160.1165959481752--