lua-users home
lua-l archive

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


on 14/6/02 8:44 PM, Steve Dekorte at steve@dekorte.com wrote:
> On Friday, June 14, 2002, at 01:43  AM, Benjohn Barnes wrote:
*snip*
>> 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.

Thank you, that makes a more sense :) I was worried that it was a bit of a
kludge, sorry. Does the system work well then? I have trouble with Lua
sounding too good to be true :)

>> 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.

*nods* I have, and I really like the prototype approach. Is this
implementation of it successful, in general?

The tag system in Lua seems to be a very neat way of extending the language.
However, I'm intrigued by whether orthogonal extensions would tend to
conflict with each other. To illustrate; if tag methods are used to support
the prototype object model above, can the mechanism also be used to provide
operators for complex number objects? In this particular case there may be
no problem, but in general, does conflict arise?

Thanks very much,
    Benjohn