Hello --

On Mon, 12 Mar 2001, Miles Egan wrote:

> * strange precedence of boolean operators
>     Why do '||' and 'and' have difference precedence?

I don't know exactly why.  The same thing happens in Perl, which
doesn't necessitate it in Ruby but might figure in.  I actually think
it's very handy, and I don't think it does any harm.  You can always
pretend (and && or or && && ||) don't exist, if you don't like them
:-)

One thing I find interesting is that "and" and "&" have different
precedence in common usage, at least in English.  For example, if a
screenplay is written by three people, two of whom are a writing team,
you'll sometimes see:

   Screenplay by Dave Thomas & Andy Hunt and William Faulkner

where the "&" binds more tightly than "and".  Strange -- I don't
remember anyone telling us that in school, yet it seems to be taken
for granted.


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav