From: daz Date: 2005-10-28T13:37:03+09:00 Subject: Re: Expression Evaluation Problem Shannon Fang wrote: > [...] > My question is, which operator has higher priority? return or and? > /return/ and /and/ are both keywords return 1 and 2 parses as: return(1) and 2 # void expression error The return keyword isn't necessary (as you know) - - without it there's no conflict. /&&/ operator has a higher priority than /and/ def loaded? print "#$c : " case $c when 0: # return 1 and 2 # err #-> 0 : nil when 1: # return(1) and 2 # err #-> 1 : nil when 2: return(1 and 2) #-> 2 : 2 when 3: return 1 && 2 #-> 3 : 2 when 4: 1 and 2 #-> 4 : 2 when 5: 1 && 2 #-> 5 : 2 end end 6.times {|$c| p loaded? } > I have used this code for a long time, but never had this problem before... > Any change in v1.8 probably? > I think, if it ever worked, you were lucky ;) daz