lua-users home
lua-l archive

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



On Friday, June 14, 2002, at 01:43  AM, Benjohn Barnes wrote:
on 13/6/02 11:35 PM, Steve Dekorte at steve@dekorte.com wrote:
On Thursday, June 13, 2002, at 11:10  AM, Gary Makin wrote:
I'm having trouble finding an example of how to implement
inheritance using version 4.0 of Lua.

Here's one example:

http://www.dekorte.com/Software/Lua/Object/Object.lua


I understand most of this example code I think. I'm confused about the
requirement for "addSlot" though. It's used in:

    http://www.dekorte.com/Software/Lua/Object/Actor.lua

Is it a mechanism to allow a method's scope to be a "derived" object, rather
than the object that the method is defined in?

Nope - just a convenience method that adds a variable, a setter and a getter all at once.
It's not necessary at all.

Is there a document describing this approach to implementing a prototype
object model?

It's based on NewtonScript's object model. You might check out some NewtonScript books.

Steve