[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Perferred OO System? Alternatives to even OO?
- From: Damian Stewart <damian@...>
- Date: Tue, 10 Oct 2006 13:44:34 +1300
Zed A. Shaw wrote:
1) What's people's favored OO system for Lua and the advantages/disadvantages?
Well, I use Julien Patte's YACI (with my bugfix applied :-), available at
http://lua-users.org/wiki/YetAnotherClassImplementation
See the bottom of the page for the bugfix.
Good: you don't have to mess around with all that ugly setmetatable
stuff, you get a magic constructor method (init()), and you get nice
tidy access to superclass methods if you want to overload something.
Bad: *all* variables are protected a la C++, ie shared with all lower
levels of the inheritance tree. If your superclass has a variable called
state, you cannot have a subclass that also has a variable called state.
--
f r e y
live music with machines
http://www.frey.co.nz