From: botp Date: 2012-02-02T17:57:42+09:00 Subject: Re: Multiple assignment in conditional On Thu, Feb 2, 2012 at 3:47 PM, Robert Klemme wrote: > On Thu, Feb 2, 2012 at 3:56 AM, botp wrote: >> indeed. ruby just checks the last assignment. >> >>> if (x,y=(a, b = foo)) >>> p 1 >>> end >> SyntaxError: (irb):17: multiple assignment in conditional >> >> but i do not know why it has to do that checking. too much work. and >> could probably slow down ruby. > > Probably because (a,b=foo) in all but the latest version always yields > an Array which is true hence does not make sense as a condition.  You > could write if (true) as well. ah, portability/compatibility. i guess we're stucked then :) thanks Robert. best regards -botp