lua-users home
lua-l archive

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


Thanks for your response.

The problem for which virtual inheritance is a solution is that of defining a base class for nodes in a signal flow graph. There are open, tick, and close functions that derived classes override. Inheritance and virtual methods in C++ are a very natural solution to this problem. 

I have a Lua version of this working with metatable plain Lua classes. I'm planning to redo some of the nodes that carry audio signals, and/or the signal buffers themselves, using cdata structs and metamethods for greater efficiency.

Regards,
Mike

On Thu, Apr 14, 2011 at 3:31 PM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
On Thu, Apr 14, 2011 at 1:25 PM, Mike Pall <mikelu-1104@mike.de> wrote:
> However I strongly suggest to resist the initial impulse to build
> up a complex class system for Lua. Inheritance is overrated, anyway.

hear! hear!

well, i've said it lots of times too...

--
Javier




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com