From: Yukihiro Matsumoto Date: 2009-08-27T08:00:09+09:00 Subject: Re: ||= with 1.8 and 1.9 ? Hi, In message "Re: ||= with 1.8 and 1.9 ?" on Thu, 27 Aug 2009 01:20:20 +0900, Rick DeNatale writes: |a = b = c | | is treated the same as | |b = c; a = c | |in other words the result of the b= is ignored. No, a = b = c is parsed as a = (b = c) so, result of the latter assignment is used for the former assignment. The point is when b here is an attribute assignment (e.g. foo.b = c), the result value from the setter method (b=) is ignored. |That's why sending :bar= is giving the result of the method. | |As for why Ruby1.9 is treating the ||= form differently, I haven't |figured that out. | | | |-- |Rick DeNatale | |Blog: http://talklikeaduck.denhaven2.com/ |Twitter: http://twitter.com/RickDeNatale |WWR: http://www.workingwithrails.com/person/9021-rick-denatale |LinkedIn: http://www.linkedin.com/in/rickdenatale |