From: sto.mar@... Date: 2013-01-06T18:08:35+09:00 Subject: Re: Best practice for &&, ||, and, or Am 06.01.2013 09:43, schrieb David Gamba: > One thing that I don't like with ruby precedence however, is that ruby > developers decided to give "and" and "or" the same precedence. But note that && has higher precedence than ||. > In my opinion, "or" should have lower precedence than "and", just like > in perl, wich allows you to do things like: > > if and or and > > Knowing that expression 3 and 4 will only be executed if 1 and 2 are not > true. > > I suppose that they went for left to right readability so you have to > evaluate everything as you read it. > > so to get something similar in ruby you have to write: > > if ( and e_2>) or ( and ) --