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

RE: Poison


> We're talking about
> having a shutdown feature that is either
> a) hand-coded, verbose, error-prone and hard to test. :-(   
> But doggedly
> WYSIWYG. :-)
> b) added by the compiler or by some other clever tool, in 
> which case it
> ceases being WYSIWYG.

A third alternative suggests itself.  You could have the low level
channel interface procedure detect the poison, discover at run time 
what all of the open channels are, and propagate the poison to them.
Also not very WYSIWYG. Tailoring the behavior would be clumsy, too.

BTW, WYSIWYG is not always a good thing.  Why else would you need
a folding editor but to obscure what you don't need to see?

> In case (b), because we're only talking about shutdown 
> behaviour, not the
> normal program flow, is losing the WYSIWYG
> property a serious problem? Perhaps not. Interestingly, it 
> might form a
> basis for a generalised exception handling
> mechanism. I don't quite understand why it is felt that this 
> is such a bad
> thing. Did I miss something?

Personally, I regard exceptions as syntactic sugar, more convenient
but not essentially different from what you can construct with 
if-then-else.  The bigger issue is how you go about changing the default
behavior. -jc