lua-users home
lua-l archive

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


On Thu, Jan 3, 2013 at 10:25 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
> what about this? make a new function named super:
> super(self):_init(title)

OK, so self._base resolves to the object's base class, that's fine.
But it doesn't point to the object

   obj:m(x) is just short for obj.m(obj,x), using convenient
assumption that the method is looked up on obj and also called on obj.

 It's hard to change the meaning of obj.m without fooling with its
metatable, or doing nasty things like actually poking the method into
obj itself.