[I'm thinking that the fourth arg should be generalized to be a  
dictionary of class methods.]

The class initialize method is special.  It is like the instance  
initialize method (which runs on each instance), but the class  
initialize method runs on each prototype.  So when you create a  
class, the class gets a prototype that is an instance of its  
superclass (which will have the instance initialize of the superclass  
run on it) and then the class system calls (from least to most  
specific) the class initialize function of each superclass (and the  
class) passing in the prototype.  Thus you can add computed values to  
the prototype that you don't want on every instance.

LzNode uses this to create the prototype dictionaries of setters,  
etc. for each subclass.

Does that meet your need?

On 2006-06-14, at 20:00 EDT, Henry Minsky wrote:

> There's a class initializer function you can declare. Example is in
> LzNode.lzs, the LzNodeClassInitialize function is the
> fourth arg to the Class function.
>
> On 6/14/06, Adam Wolff <[EMAIL PROTECTED]> wrote:
>>
>> I have a class which needs its subclasses to do some static  
>> configuration
>> at runtime. This is a bit of a pain, since you have to manually  
>> traverse
>> the class hierarchy.
>>
>> Is there a hook for this in the legals class system? Does this  
>> seem like a
>> worthwhile feature? Shall I propose a feature?
>>
>> A
>> _______________________________________________
>> Laszlo-dev mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> [EMAIL PROTECTED]
> _______________________________________________
> Laszlo-dev mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to