M. Edward (Ed) Borasky wrote:
> depending on which meaning the programmer intended. And I can't for the
> life of me understand why anyone would code
> 
> (-x).abs

Ok,

irb(main):006:0> -2.5.ceil
=> -2
irb(main):007:0> -(2.5.ceil)
=> -3
irb(main):008:0> x = 2.5
=> 2.5
irb(main):009:0> -x.ceil
=> -3
irb(main):010:0> -(x.ceil)
=> -3

To a mathematician (me) the operators appear to take different 
precedence depending on whether you have a literal or a variable. What's 
really happening is not fully explained by precedence. The lexical rules 
are important too and they are not simple.

I'll agree with you on the importance of explicit bracketing, especially 
if you have to communicate with scientists or mathematicians who are not 
programmers.

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407