On Dec 14, 2005, at 12:37 PM, P T Withington wrote:

I would vote for the class library designer having to at least say:


  <class name="baseclass" extensibility="open">

    <view name="top" extensibility="open" ... />


(or something like that) to declare that the class permits extensibility in the sense of your proposal.  And I would propose that we think about making classes in a library not extensible outside the library by default (as in Dylan).


I also like that you should have to declare your intension to extend, to allow the compiler to tell you when you made a type-oh.


If we did this, we'd also want scoping on node names. (I think we might want scoping anyway.) There's a problem I just ran into with placement, where depending on the order in which subviews are instantiated, a view may be placed (using placement or defaultplacement) either within the intended subview, or within an entirely unexpected subview. This would happen if the names were the same:

<class name="v1" defaultplacement="content">
  <view name="structure">
    <view name="content">
    </view>
  </view
</class>

<v1>
  <view name="content" placement="structure"/>
  <view name="v2"/>
</v1>

Here, v2 will end up inside the wrong subview (the direct subview introduced by the v1 instance). But if v2 were declared first (assuming initialization matches lexical order), then it would go where the class declaration intended it. 

The right solution here, I think, is to have scoped naming, so that the "content" subview declared in the instance of v1 would not be incorrectly matched when searching for the "content" subview declared in the class v1.

I see scoping here as just basic encapsulation, something we don't really provide. The problem is similar to the capture problem in macro expansion. 

Even given that it is a scripting language, the current semantics are pretty loose.

jim


Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to