lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Tony Finch wrote:
>
> One of the significant oddities in Lua is the distinction between methods
> called using the : operator and metamethods called by the language runtime
> and some library functions.

Indeed.

> However I don't think it can keep backwards compatibility without
> sacrificing efficiency. The key change is a version of the old idea of
> making the lookup algorithm for : different from . which allows more
> natural support for class-style OOP by making it easy to separate instance
> variables from methods.

Not only instance variables, data too (if the instance is the container
for arbitrary data).

I'm advocating for a change to the colon operator for nearly 10 years[1]
and I've given up by now.

Ciao, ET.

[1] i.e. http://lua-users.org/lists/lua-l/2001-11/msg00459.html