Right.  If we had LzDictionary that did what you wanted, LzNode could  
inherit from that.

It seems we want something like a base class that is a dictionary  
with events, then a class that has parent/sibling/child relations,  
then the full LzNode with all its attendant cruft.  That middle class  
is probably what is now called LzDataNode, no?

I happen to be working on a dictionary class, because I am trying to  
replace all the __proto__ mucking, and I'd also like a dictionary  
with a containsKey operation that won't tell me all dictionaries come  
pre-loaded with a toString entry :).  [There is an issue with the new  
class implementation putting a constructor property on each  
instance.  Need to fix that...]

On 2006-05-22, at 16:59 EDT, Adam Wolff wrote:

> well I want to avoid the overhead of creating a whole node. I also  
> want to
> be free to define attributes with names like "parent"
>
> A
>
> On May 22, P T Withington wrote:
>
>> On 2006-05-22, at 16:24 EDT, Adam Wolff wrote:
>>
>>> recently some of the work I've been doing has led me to creating
>>> dictionaries of attributes that I want to be able set essentially  
>>> as if
>>> they were LzNodes. Right now, the <event> syntax doesn't support  
>>> this,
>>> even though the runtime allows it.
>>>
>>> What we do we think. Are you allowed to do this:
>>>
>>> <node name="thing">
>>>    <method name="construct" args="p,a">
>>>        this.dictionary = {};
>>>        this.dictionary.aProp = null;
>>>        ...
>>>
>>>
>>>    <method name="setDictionaryValue" args="n,v">
>>>        this.dictionary[ n ] = v;
>>>        if ( this.dictionary[ "on" + n ] )
>>>            this.dictionary[ "on" + n ].sendEvent( v );
>>>
>>>    </method>
>>
>> Hm setDictionaryValue looks suspiciously like setAttribute to me.   
>> I think
>> what you are really asking for is for a dictionary class that  
>> supports
>> setAttribute (and events) that LzNode inherits from (or mixes  
>> in).  This fits
>> nicely with tomorrow's topic of refining LzNode...
>>
>>

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

Reply via email to