On Dec 8, 2005, at 7:27 AM, [EMAIL PROTECTED] wrote:
> But this will net you a parse error ('2' is not a valid method
> name):
>
>  obj.meth 1, 2 { |i|
>    puts i
>  }

Yikes!  Not sure what's up there.  What does the {...} bind to then?   
The 2?  If so, why is 2 considered a method.

> And these two parse equivalently:
>
>  obj.meth 1, zog { |i|
>    puts i
>  }
>
>  obj.meth( 1, zog { |i| puts i } )
>
> Think of {} as being more "clingy" than do...end.

That I can parse mentally. :)

> Basically, {} has higher precedence than do...end, just as (among
> otherwise equivalent operators) && has higher precedence than
> 'and', and || has higher precedence than 'or'.
>
> I'm sure Ter hates Ruby now. :)

Well, I am trying to ignore edge cases while I learn the language ;)   
Starting with the warts is probably not a good idea ;)

Ter
_______________________________________________
Rubygrammar-grammarians mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians

Reply via email to