From: Joel VanderWerf Date: 2010-02-06T04:45:21+09:00 Subject: Re: when should one use "and" and "or" botp wrote: > On Fri, Feb 5, 2010 at 3:14 PM, Brian Candler wrote: >> No, but it's essentially inherited from perl. These operators have >> extremely low precedence, so without parens your statement was being >> parsed as something like >> >> (when x==1) or x==2 >> >> I think the typical perl use is something like: > .... > > but brian, i'm still inside the "case" block. can't ruby sense that? And shouldn't 'when' have the same precedence as 'if'? At least for 'or', you can use a comma instead: case when x==1, x==2; puts "1 or 2" end but it doesn't read as well, and there's nothing that works like this for 'and'.