From: "Peña, Botp" Date: 2008-07-29T16:47:09+09:00 Subject: Re: and and or in case From: Ben Brightwell [mailto:neogia4@gmail.com] # The way I see it (and also the way I practice it today) is to always # always always use "&&" or "||" over "and" or "or", respectively. # The words "and" and "or" are lower in the order of operators than the # symbols "&&" and "||". This is intentional for beginner # programmers to be able to "read" the code rather than work out the # logic of the code. Ben thanks, but i'm not convinced. It still does not answer why it is not allowing in case-when clause yet allowing it in if-elsif, sample, if 1==1 and 2==2 p "ok" end "ok" #=> nil case when 1==1 and 2==2 p "ok" end SyntaxError: compile error (irb):5: syntax error, unexpected kAND, expecting kTHEN or ':' or '\n' or ';' when 1==1 and 2==2 ^ (irb):7: syntax error, unexpected kEND, expecting $end from (irb):7 from :0 arggh, i love using case-when and and/or and now both do not work together?? quite a surprise to me there. kind regards -botp