lua-users home
lua-l archive

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


Javier Guerra wrote:
and what would be the advantage of doing it your way?


Two advantages, of tenuous merit.

I believe my suggested implementation of self would (slightly) improve function call performance by obviating the need to push an extra "hidden" argument on the stack. This is based on my belief that typical function call implementations already contain the calling object's / caller's reference in the larger call frame. That is, the "self" information is already on the stack, if not in the argument list. -- So this is not much of a performance hit in any case.

The other "advantage" is really the religious point about style. And that is that the language could be more uniform without the colon operator -- i.e. "even more austere". But that's not really an advantage, that's a choice about style and (highly subjective) readability.

// Brian