[grammarians] ambiguity with method call?

Terence Parr parrt at cs.usfca.edu
Tue Nov 29 16:40:13 EST 2005


On Nov 29, 2005, at 1:23 PM, Sean O'Halpin wrote:
> It gets worse ;)
>
> There is also the case where [] can be a synonym for Proc#call, e.g.
>
> foo = proc {|x| x*x }
>
> foo [2] #=> 4

Yikes.  If the AST needs to differentiate, then we've got trouble. ;)

I'm getting a sneaking suspicion that I'll not be able to build a  
grammar until I've spent a LONG time with ruby.  Hmm...not sure I  
want to reward this sort of language design...

Ter


More information about the Rubygrammar-grammarians mailing list