From: Yusuke ENDOH Date: 2011-02-24T23:37:56+09:00 Subject: [ruby-core:35373] Re: [Ruby 1.9 - Bug #4440] [Open] odd evaluation order in a multiple assignment Sorry, I've sent a Japanese mail to ruby-core by mistake. Translation :-) Hi, I have believed that Ruby evaluates everything from left to right, but was betrayed by a multiple assignment: def foo p :foo [] end def bar p :bar end x, foo[0] = bar, 0 Because "foo" precedes "bar", I expect that this prints :foo and :bar in this order, but actually :bar and :foo. I think that this is a matter in practice. For example, x, y = y, x is used to swap the two, but obj, obj.foo = obj.foo, obj does not so. This kind of code is often written to rotate a tree. In fact I realized this behavior when I was writing a splay tree, like this: t.left, t.left.right, t = t.left.right, t, t.left I don't think that this should be fixed in 1.9 series, but can we fix this in 2.0? Some people (in Japanese IRC) said me that the behavior is expected, but note that foo[0] = bar does print :foo and :bar in the order. -- Yusuke Endoh