[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: rethinking method calls with __mcall metamethod rather than __index/__call
- From: Daniel Silverstone <dsilvers@...>
- Date: Fri, 19 Jun 2009 12:15:04 +0100
On Sat, 2009-06-13 at 16:25 -0400, David Manura wrote:
> An alternative, proposed for consideration, is to provide a new
> __mcall metamethod for method calls (a.k.a. message passing). If
> __mcall is not provided, Lua would revert to the old behavior of
> consulting __index and __call instead. The proxy example above would
> be reimplemented more cleanly as follows:
Aranha[1] uses __methindex to provide as closely compatible behaviour as
possible, but still offer separation of methods and members.
__mcall rather than __methindex would offer a minor speedup, but I
wouldn't have thought it would be much. How measurable is it?
Certainly I think it'd be nice to see the core Lua distribution make the
distinction between foo:bar() and foo.bar() at the metamethod level.
D.
--
Daniel Silverstone http://www.digital-scurf.org/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895