lua-users home
lua-l archive

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


On 9/18/07, David Manura <dm.lua@math2.org> wrote:
> Duck wrote:
> >  setmetatable(t,{__index=c})

There's an implementation of the third way in
http://lua-users.org/wiki/SimpleLuaClasses,
showing how inheritance etc works.  There are some interesting
trade-offs, but it definitely makes sense to have a metatable
corresponding to the 'class' object of other languages like Smalltalk
and Python - that is, a metatable shared by all instances of that
class type.

steve d.