On Jan 14, 2008 9:01 AM, Lars <larsch / belunktum.dk> wrote:
> On Jan 13, 8:16 pm, Robert Dober <robert.do... / gmail.com> wrote:
> > Personally I'd love to have that changed.
>
> [] is an operator (the index operator). I would expect [] to have
> higher precedence than anything that follows it. Although implemented
> as such, it should not be seen as a function call, IMHO.
>
> If
>
>     foo[i] #=> 42
>
> Then I would expect
>
>     foo[i] { }
>
> to be the same as
>
>     42 { }
>
> which makes little sense.

So operators that you can redefine and execute as a method cannot
except a block as a general rule of thumb?

I would think foo[i] { } would be parsed as (foo[i] { }) as a single
piece, especially if you defined it to receive a block.