lua-users home
lua-l archive

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

PiL finishes the chapter on object-oriented programming with the rather
Scheme-like approach of implementing objects as function closures. Would it
make sense to define obj:msg( ... ) as meaning obj( "msg", ... ) if obj were
a function? This has the downside of meaning that the syntax is no longer
simply sugar, but it had already ceased to be treated as such in the

It might actually be nicer to have it mean obj( obj, "msg", ... ) but that
may confuse parameter counts in the implementation since the case where obj
isn't a function doesn't pass the message to the method.