From: Hal Fulton Date: 2010-03-12T16:30:24+09:00 Subject: Re: result of assignment is not the return value --0016e64698444b59500481951c3f Content-Type: text/plain; charset=ISO-8859-1 On Thu, Mar 11, 2010 at 9:39 PM, Nathan Beyer wrote: > On Thu, Mar 11, 2010 at 6:03 PM, Yukihiro Matsumoto > wrote: > > > > It's a design choice. We defined the value of the assignment as the > > value of the right hand expression, not the return value from the > > assigning method. > > > > matz. > > Ahh. Thanks. I figured it was something like that, but I couldn't find > any concrete reference to it. > > I have thought about this for awhile. One rationalization is this. Think of "stacked assignment" which Ruby borrows from C. x = y = 5 An accessor acts much like a simple assignment: x = foo.bar = 5 # same as: x = (foo.bar = 5) In this case, it would be weird if x ended up being anything other than 5. Hal --0016e64698444b59500481951c3f--