[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: RES: RES: RES: idea of vision of blueprint of ROADMAP of Lua core
- From: Jay Carlson <nop@...>
- Date: Sun, 16 Jan 2005 12:17:04 -0500
On Mon, 2005-01-17 at 04:07, André de Leiradella wrote:
The thing the bothers me most is how to call inherited methods.
An object is nothing more than a table of closures.
OO is just a minor subset of functional programming.
Inheritance is no problem, just modify the table
in the derived class .. which is just a function
that calls the base function first to
make the initial table.
["meth1"] = function () return x end;
["meth2"] = function () return 2 end
Note -- no 'self' argument is needed,
the private variables of a class can be
refered to directly in the method without
any 'self'. Also no metatables or environments
(whatever they are) are needed.
All you need is lexically scoped functions and tables,
Lua already has both.
How do you refer to object slots defined by parents?
How do you do super dispatch?