Phillip Gawlowski wrote in post #1026187:
> On Tue, Oct 11, 2011 at 10:08 PM, Robert Klemme
> <shortcutter / googlemail.com> wrote:
>>
>> Yes, but spaces do not become dots except those before an operator.
>
> Except that Ruby doesn't have operators. , -, *, ** are all methods.
> Granted, they get special treatment, but it's syntactic sugar so that
> they look like operators.

From the point of view of the parser, they are operators. From the point 
of view of execution, they are method calls.

The statement "spaces do not become dots except those before an 
operator" is not how it works. The expression is parsed just as in any 
other language:

       expr
      / | \
     a  +  b

and from this a syntax tree is built equivalent to a.send(:+, b), and 
then that's what's executed.

The reason that a + f b doesn't parse is explained at
http://www.ruby-forum.com/topic/2762669#1026142

It's because it parses as (a + f) b. And if the parsing precedence were 
changed so it became a + (f b), then other undesirable behaviour would 
result.

-- 
Posted via http://www.ruby-forum.com/.