Quoting Terence Parr <[EMAIL PROTECTED]>:

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

It doesn't.  Assuming 'anything' is a local variable,

 anything [whatever]

simply sends the message [] to the object referenced by 'anything',
with the value of 'whatever' as a parameter.

In response to the [] message, Proc objects call themselves with the
given parameters.  In response to the [] message, Array objects
return the indexed value(s).  But that's a runtime consideration
you don't have to care about.

> 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...

I'm afraid folks are making it sound much worse than it really is.

See my other post.  If you've already got the lvar-versus-method
thing worked out, foo [2] shouldn't be a problem.

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

Reply via email to