[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Colon syntax minor inelegance
- From: Eduardo Ochs <eduardoochs@...>
- Date: Thu, 27 Jan 2011 14:17:41 -0200
On Wed, Jan 26, 2011 at 4:37 PM, steve donovan
> On Wed, Jan 26, 2011 at 7:52 PM, Peter Cawley <firstname.lastname@example.org> wrote:
>> argument list, but this is ugly from a language design point of view,
>> as then "foo:bar(...)" becomes a special-case of redefining the
>> semantics of something which is already valid syntax.
> So the question would be: what is more ugly, having to live with
> different implementations of foo:bar and foo:bar(...), or not having
> any meaning for foo:bar ?
> Having the auto-closure available would be useful when specifying
> callbacks to object methods.
> steve d,
A "__colon" metamethod - that would be invoked only on the
case of the "foo:bar" without the trailing arguments - would be a
nice alternative to auto-closure, I think... some people would
like to create a new closure every time that the interpreter executes
a foo:bar, others would prefer to cache these closures somehow...