From: Rando Christensen Date: 2002-11-21T22:27:15+09:00 Subject: Re: difference between "and" and "&&" Thu, 21 Nov 2002 15:04:59 +0900: Pe�a, Botp ("Pe�a, Botp" ): > Hi sir David [mailto:dblack@candle.superlink.net]: > > You wrote: > > > Yes. The first one is equivalent to: > > > > (haveBoth = a) and b > > > > The second is: > > > > haveBoth = (a && b) > > > > I am surprise and I'm new to Ruby :-) > > I do find both structurally same, but why the difference in > precedence? > > Pls enlighten.. Remember, if in doubt, you can always add more parenthesis; not only does it make sure that Ruby (or any language, really) understands what you want, it also makes sure that you understand what you want. ;) I usually do that anyway, to keep myself in check- In any case where i'm using &&, ||, etc, throw it in a () to make sure my meaning is understood. -- < There is a light that shines on the frontier > < And maybe someday, We're gonna be there. > < Rando Christensen / rando@babblica.net >