lua-users home
lua-l archive

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


On Thu, May 1, 2014 at 6:24 PM, Thomas Jericke <tjericke@indel.ch> wrote:
> That's already the case. The : operator is inconsistent and the use of
> the colon operator is hard to explain as it is now. I often get calls from
> customers who ask me: "When do I have to use the ':' operator?"

It does puzzle newcomers, but it's the price of "no magic".  I suspect
Lua would be slower if every function call had to work out if it was a
method ....  Another point of view: OOP is not fundamental to Lua as
it is with Ruby or Python; a "method" call is precisely something that
uses colon-syntax, which is convenient sugar for "lookup up on object
and call, passing object first".

> Maybe it's just because I dislike the colon operator as it is now in Lua that I don't
> have scruple to mess around with it ;-)

Fair enough ;)  Sorry I keep calling it a 'proposal', maybe the word
'patch' is more neutral.  And we all have the right to fool with our
copy of Lua ;)

steve d.