Module flower.class
This implements object-oriented style classes in Lua, including multiple inheritance.
This particular variation of class implementation copies the base class functions into this class, which improves speed over other implementations in return for slightly larger class tables. Please note that the inherited class members are therefore cached and subsequent changes to a superclass may not be reflected in your subclasses.
Info:
- Release: V3.0.0
- Author: Makoto
Functions
class:__call (...) | This allows you to define a class by calling 'class' as a function, specifying the superclasses as a list. |
class:__new (...) | Generic constructor function for classes. |
class:__object_factory () | Returns the new object. |
Functions
- class:__call (...)
-
This allows you to define a class by calling 'class' as a function,
specifying the superclasses as a list. For example:
mynewclass = class(superclass1, superclass2)
Parameters:
- ... Base class list.
Returns:
-
class
- class:__new (...)
-
Generic constructor function for classes.
Note that __new() will call init() if it is available in the class.
Parameters:
- ...
Returns:
-
Instance
- class:__object_factory ()
-
Returns the new object.
Returns:
-
object