lua-users home
lua-l archive

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


--- 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