On Dec 2, 2005, at 7:02 AM, Henry Minsky wrote:
I think this is a good idea.

I do too. The event/method override education issue is significant and this proposal cleanly addresses it.


The first time I saw the '<method name="methodName" event="eventName">' idiom I thought it was pretty ugly; it's one of those idiomatic usages that may have clear semantics but requires effort to read. It'll be nice to get away from it.

This proposal should be relatively inexpensive to implement, and we should be able to phase it in compatibly in Ginger (by leaving in the old overloaded syntax) and then move over completely in StarAnise.

Tucker, can you copy the content into a new wiki page and link to it from http://wiki.openlaszlo.org/Enhancement_Proposals? Filing a tracking bug would be a good idea as well.

jim

On 12/1/05, P T Withington <[EMAIL PROTECTED]> wrote:
Please comment.

---

I'd like to propose that we add two new tags to the language:

   <event name="eventName" />

This would replace the current idiom of declaring your intention to
send an event by using `<attribute name="eventName" value="null" /
>`.  Declaring events means that you can then send them without
getting a debugger warning (because the compiler will correctly
initialize them).  It also gives us freedom in the future of choosing
how to implement events.

   <handler name="eventName" [reference="..."] [args="..."]>
     ...
   </handler>

The `handler` tag in this form would be equivalent to the current
`method` tag with the same properties, which would be deprecated.
This change has two beneficial effects:  1) it simplifies the
`method` tag, which would subsequently be used only to define
methods, and 2) it permits clearly documenting that  handlers are not
overridable by subclasses (in meta-object protocol parlance method-
combination for handlers is to invoke all methods, not just the most-
specific).

The current idiom:

   <method name="methodName" event="eventName" [reference="..."]>
     ...
   </method>

will be replaced by:

   <handler name="eventName" [reference="..."] [method="methodName"] />

   <method name="methodName">
     ...
   </method>

This change is more complex, but I believe it makes the method tag
more understandable, by simplifying it's definition.  This is the
idiom that would be used to override an event handler, by overriding
the method that handles the event.

The `handler` tag in a class definition can be used to define a
default handler and to extend the schema to permit specifying the
handler body as an opening tag property:

   <class name="className" ...>
     <handler name="eventName" />
     ...
   </class>

permits:

   <className eventName="... _javascript_ ..." />

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



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-dev mailing list

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