From: "Wolfgang Nádasi-Donner" Date: 2007-01-23T05:00:10+09:00 Subject: Re: Bug in Ruby with adding strings? Gregory Brown schrieb: > it may be parsing as 'foo' + x.to_s(+'bar') since to_s can sometimes > take an argument. This makes sense. When translating the infix notation to method usage (don't know if this will be done by the interpreter), the first step is 'foo' + x.to_s +'bar' => 'foo'.+(x.to_s +'bar') "String#+" has one argument, so "x.to_s +'bar'" must be one argument. When looking to "x" it is not clear for the interpreter, what the result of "x.to_s" will be, but it knows, that "to_s" has an (optional) argument. So it tries to find "String#+@" method for 'bar' and fails. The possibility to backtrack after failure and try first to evaluate "x.to_s", which returns the string "'1'", an then to compute "'1' +'bar'" (works without any problem) will not be done due to good reasons for the general case. Wolfgang N�dasi-Donner