From: Mike Stok Date: 2006-03-25T01:42:59+09:00 Subject: Re: Benefit of multiple addition/subtraction operators On 24-Mar-06, at 11:32 AM, ara.t.howard@noaa.gov wrote: > On Sat, 25 Mar 2006, Nate Smith wrote: > >> Hello, >> >> What is the benefit in ruby of allowing the following syntax: >> >> in irb: >> >> irb(main):005:0> 1 + + + + 3 >> => 4 > > > you are just saying > > 1 + (+(+(+3))) > > > in otherwords you have made 3 __very__ positive. [...] But be aware that ----4 doesn't make 4 very negative. The unary + and - are useful, making x = -5 a little more conventional looking and convenient to write than x = 0 - 5 Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply.