[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: overriding method of a single object and calls its metatable method ?
- From: gary ng <garyng2000@...>
- Date: Sat, 3 Mar 2007 18:46:14 -0800 (PST)
--- PA <petite.abeille@gmail.com> wrote:
>
> On Mar 03, 2007, at 16:11, gary ng wrote:
>
> > how can I easily define a method a.foo which is
> > equivalent to this :
>
> usually you will need to keep track of your super
> class, look up the
> method implementation and pass self to it, e.g.:
>
Thanks but I don't need the full blown class system
for this particular case. I would just hard code the
"object metatable" for now as I know it.
Just wondering why "getmetatable(my_object_as_table)"
don't return the metatable, is it only for C created
userdata and why not for lua created object ?
As otherwise, that seem to be the most natural way for
"a.super = getmetatable(a)"
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news