From: ts Date: 2004-07-10T23:07:15+09:00 Subject: Re: weird behaviour >>>>> "D" == Dave Burt writes: D> So D> "".to_s +"" D> means D> "".to_s(+"") it's a little more complex :-) "".to_s +"" is interpreted as "".to_s(+"") # unary plus and "".to_s+"" is interpreted as "".to_s + "" # addition *but* "" + "".to_s +"" is interpreted as ("" + "".to_s) +"" this is why ruby give an error, it has an unary plus which don't give a valid expression D> and adding parens like so: D> "".to_s() +"" D> would correct the problem. yes, because with "" + "".to_s() +"" it's interpreted as ("" + "".to_s()) + "" the second `+' is seen as the addition not the unary plus like in this case :-) "" + "".to_s+"" Guy Decoux