[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: throw-catch :cancel



At 8:55 6/5/95, Dave Yost wrote:
>In article <v02110105abf8da609000@[198.112.74.171]>,
>>
>>I've previously expressed the opinion that handling the cancel button on
>>dialogs by doing a throw to :cancel is just a bad idea.  It should signal a
>>condition, just like anything else.  This would allow the user to use a
>>global condition handler instead of a stack-based one which wouldn't be
>>applicable when the event is handled in another process.
>
>Is the more general statement true?
>Are throw/catch obsoleted by conditions in general?
>(I came in after conditions were invented.)

Yes and no.  If their cost (in terms of efficiency) were
equivalent you could make a case for it, but throwing
is often more efficient than signalling a condition.  In
fact, most implementations of conditions are implemented
on top of throw.

>
>Also, you seem to leave out the possibility of
>per-thread condition handlers.  Did you mean to do that?

Only in the context of this discussion.  The original problem was that
someone had set up a window event handler that did a throw.  However,
because MCL 3.0 handles events in a different process, the target of the
throw wasn't dynamically present when it was being executed.  Of course,
the vast majority of all condition handlers are per-process.

>
>Dave Yost
>    @    .com