From: Phrogz Date: 2007-07-28T07:10:01+09:00 Subject: Re: n00b if condition quest On Jul 27, 4:43 am, "Robert Dober" wrote: > On 7/27/07, dbl...@rubypal.com wrote: > > On Fri, 27 Jul 2007, Brett Boge wrote: > > > if (a = b or a = c or a = d or a = f) > > You mean == rather than = , but in any case, try this: > You are right for sure that OP meant ==, but let us answer the > original question too ;) > > a = [b,c,d,e,f].compact.first Your solution forces the evaluation of b/c/d/e/f, which the OP's does not (thanks to the miracle of short-circuit boolean evaluation). I think the 'correct' answer to the typo-incorrect question is: if a = (b or c or d or f) To be super clear: this is only because we're talking about assignment instead of an actual equality test.