After discussion, we decided the right thing to do for now is:  In  
the interface:

   /* abstract */ var nodeType;

and in the concrete sub-classes:

   var nodeType = <correct value for the class>;

[And someday the compiler will warn if an abstract var is not defined  
in concrete subclasses].

On 2006-09-19, at 11:03 EDT, P T Withington wrote:

> Ok, we see why this is screwing up.  The nodeType slot is effectively
> an 'abstract var', declared in the superclass and expected to be
> overridden in the subclass, and then we are being _really_ tricky and
> doing the overriding in the trait.
>
> Sadly, this is a pretty decent example of why some people believe it
> is too confusing to allow implementation in interfaces.
>
> I think the most O-O way to fix this would be for LzDataNode to
> declare nodeType (with no initial value), and for the concrete
> subclasses to set the nodeType to the appropriate value in the
> initialize function (or set it on the prototype in the static
> initilize function).
>
> Probably as part of implementing the override keyword, we should
> implement the abstract keyword too, so we could use `abstract var` to
> mean sublcass must initialize.
>
>
> On 2006-09-19, at 09:26 EDT, Philip Romanik wrote:
>
>> I'll confer with Tucker, and then check in a change, but the  
>> following
>> change appears to work.
>>
>>
>> Change this line in LzDataElement.lzs from
>>
>>
>>         nodeType = LzDataNode.ELEMENT_NODE;
>>
>>
>> to
>>
>>
>>         var nodeType = LzDataNode.ELEMENT_NODE;
>>
>>
>>
>> Phil
>>
>> _______________________________________________
>> 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


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

Reply via email to