[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ideas about colon operator syntax (and a patch in the work)
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 1 May 2014 18:44:16 +0200
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.