[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: first class ':'
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 15 Sep 2009 10:17:07 +0200
On Tue, Sep 15, 2009 at 10:00 AM, David Kastrup <firstname.lastname@example.org> wrote:
> But I like the things that are just syntactic sugar in Lua: it means
> that you can exhaustively explain them in more basic terms in one
OK, this is sugar we know so well:
- obj:method() becomes obj.method(obj)
But in the case of a obj:method _without_ parentheses, then there is a
somewhat more elaborate expansion as a closure.
That feels manageable.
First-class ':' has some cute advantages, it is an operator and
presumably has a metamethod, so that we can finally distinguish
between method and table lookup, _if needed_.
But I worry about the complexity of the change, possible performance
implications, and more semantics that, yes, have to be explained ...