On Dec 14, 2005, at 8:32 PM, Jim Grandy wrote:
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.)

Scoped node names was the design, and is used in the semantics for referring to nodes.  Section 2.2.2 of http://www.openlaszlo.org/lps-latest/docs/guide/program-development.html#program-development.canvas tries to say this, but it's pretty minimal.

I didn't know that placement ignored this.  It wasn't intended that the override ignore it too, for exactly the reasons that you and others have raised.

This does leave a gap in how to refer to a node that is not an immediate child of the class.  In the case of references from within the same class, you can label all your intermediate nodes on the way down from the class to the target node, and use of long paths such as "classroot.a.b.c".  This is verbose and adds a maintenance burden, but works.  Allowing dotted paths in the placement and override attributes would address this for those features, in a similarly clumsy fashion.

A better solution would be to make @id local, when it is used within a class definition.  This has been on the wishlist for a while now, and I believe has been scheduled against OL3.2.  I'll write it up next.
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to