From: botp Date: 2012-02-02T11:56:00+09:00 Subject: Re: Multiple assignment in conditional On Thu, Feb 2, 2012 at 4:15 AM, Joel VanderWerf wrote: > You can trick ruby: > > def foo; nil; end > > if (_ = (a, b = foo)) > >  puts "outcome 1" > else >  puts "outcome 2" > end > > So, the question is parsing, not semantics. 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. kind regards -botp