And handling user errors in a GUI application is a task for event handling,
*not* exception handling. I agree that both mechanisms share large parts
of the infra-structure supporting them. But I make a strong conceptual
distinction between them.
Which leads to the question, does Perl6 have or need a build-in event
system on the language level?
--
Hear, hear.
Isn't just an exception a naughty event? But when you think about it,
isn't all programming about suggesting events and handling what happens
next?
Most of what a programmer does is suggest events to do (e.g., open file)
and then handle the 'events' that happen next (e.g., file not found) and
then suggest some more events (e.g., die). At the moment the programmer is
the top-level event handler (e.g., damn - why didn't that work?) - but
maybe some of this hassle could be handed off?
Is there a way to turn the exceptions type matching / depth finding
problem inside out?
From the point of view of the operating system a program is a nasty
exception to its normal running environment - your whole program is a kind
of big exception!
Like someone intruding on a conversation the programmer tries to change
the topic of the operating system. "Hey can you get that network socket
for me?"
Programmers are constantly trying to change the "topic" of conversation of
the operating system. "Hey drop what you're doing. This is important. Get
me that file."
But some of the nastiest (and exception raising) problems arise from the
conversational disconnect between operating system and program (e.g.,
"Sorry that port is blocked", "Sorry can't find that file", "Socket
closed" etc).
Is there a place in the room for a third party to the conversation?
Somebody who could ...
Smooth over misunderstandings?
Do translation if either party doesn't understand?
Queue what should be the next topic of conversation?
Remember how topics are meant to be handled?
Provide a log of what was said?
Is there a way of integrating Perl's natural ability to stay on topic ($_)
with exception handling, and event handling?
Just some thoughts ...
NIge