From: "Matthew K. Williams" Date: 2010-05-04T23:39:48+09:00 Subject: Re: Something I expected to work, but didn't! On Tue, 4 May 2010, Aldric Giacomoni wrote: > Gavin Sinclair wrote: >>> should be allowed. "Path of least surprise" and all that, plus this >>> looks cleaner: >>> >>> x, y, z = 2, 4, 6 >>> x, y += z >> >> I have no idea what that code snippet is intended to do! So it >> doesn't look cleaner to me. >> > > Yes.. I'm not sure this follows the POLS principle. It probably follows > the Path Of Least Keyboard Access principle, but POLKA should remain a > dance. I'm not sure why you would think that the POLS is for the operator on the right to be applied to both of the objects. The way that x,y = foo,bar works is that what is on the right side is considered as an array, and the elements are assigned to the variables on the left. It only works on assignment, not any random operator. Now, you could say: [x, y].each {|v| v += z} But x,y += z doesn't seem obvious to me. YMMV, of course. Matt