lua-users home
lua-l archive

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


Brilliant -- why choose when you can do both! Thanks

On Mon, Mar 22, 2010 at 4:53 PM, Timm S. Mueller <tmueller@schulze-mueller.de> wrote:
On Mon, 22 Mar 2010 16:38:49 -0500
James McLaughlin <jomclaughlin@gmail.com> wrote:

> Does anyone have a good example of a module inheriting from another module?

What turned out advantageous for me was to distinguish between new()
and newClass(), and to use the super class as a second argument to the
module function. This made it a fool-proof workhorse even for large and
complex class libraries, at least for my needs.

You can check out my approach at http://tekui.teklib.org/ . The base
class is tek/class.lua - see also
http://hg.teklib.org/tekui/file/a5823c144f8f/tek/class.lua#l .
Documentation is here: http://tekui.teklib.org/manual.html#tek.class

- Timm

--
Timm S. Mueller <tmueller@schulze-mueller.de>
Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 93624410, http://www.schulze-mueller.de/