From: Mark Hubbart Date: 2004-04-01T01:20:48+09:00 Subject: Re: Syntax: eval( "a = !a) != eval( "a = not a") On Mar 31, 2004, at 3:12 AM, Jean-Hugues ROBERT wrote: > For the sake of curiosity, I would still like to know *why* things > were designed this way. A way that makes "not" rather useless to me > (besides the rare case where I would want to avoid a redefined !()). > > i.e. why is "not" 's precedence lower than assignment's one ??? The "and", "or" and "not" operators all have lower precedence. If you need higher precedence, use "&&" "||" and "!". The word-based boolean operators are provided as a counterpoint to the higher priority symbol ones. The lower precedence allows you to get away with less parenthesis in certain situations. *>> x = 23 == 23 && ! y = 42 == 23 #=> false *>> [x,y] #=> [false, true] *>> x = 23 == 23 and not y = 42 == 23 #=> false *>> [x,y] #=> [true, true] --Mark