[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Matter of class/instance form/function...
- From: "steve donovan" <steve.j.donovan@...>
- Date: Tue, 18 Sep 2007 12:47:17 +0200
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.