Why can't low and high level events share the same abstractions, and even be placed on the same event queue? I also think exception-handling has much in common with event handling (on: exception do: aBlock). The exception looks to me very much like an 'event' that the block is told about. Is it possible to fuse these three mechanisms into a common abstraction and reuse a lot of the code, or is this just wishful thinking on my part?
Peter
I think you are definitely on to something here. If you look at exception handling from an event point of view, what you are doing is simply registering an insterest in whether a particular chain of calls results in an exceptional situation. In a sense, one method context becomes an observer of a called method context. You can even take it one step further and say that when we wait (in a synchronous call) on the result of a message send, we are registering an interest on any (there can be more than one answer from a method in a generic messaging approach) answers that a method context has to give. In fact, in playing with asynchronous messaging, I discovered that places where I would have used a "Notification" type of exception to indicate progress of a method, I could simply send multiple answers through the answer queue for a method context.
All of this leads me to believe that there is in fact a common, unified approach to messaging (where answers are concerned), exception handling, events, and dependecies.
- Stephen