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

Re: New Lisp ?



Andreas Bogk <andreas@andreas.org> writes:
> Jeffrey Siegal <jbs@quiotix.com> writes:
> 
> > What happens in Java is that you have to at least declare the exceptions
> > up the chain anyway (the compiler will reject a method that doesn't
> 
> Yes, and that bothers me to no end.  I want to have specific code that
> knows about an exception in exactly two places: where it is generated,
> and where it can be handled.  All the code inbetween doesn't need to
> know more than that an operation has failed and that it needs to clean
> up.

Well the `two endpoints' part of your desire is fairly easily met, but
the `cleaning up from the middle' is rather harder. I would speculate
that the only way to make that really work correctly is to have
language (& GC) support for finalizers, and even that is error prone.
In my experience, error-handling has to be designed in early. My
experience with exception-based systems (primarily Smalltalk w/some
C++) has not led me to believe that they are dramatically
cleaner.

Please note: I am talking about a matter of degree here. My biggest
beef with exception-based systems is that they end up getting used far
too generally (for unusual code paths rather than actual failure
handling). They're nice when used for communicating distant problems
(the canonical I/O system failure is ideal), but they're not as clear
as an if statement by any means. In the past I've dealt with this
through architectural constraints, but that experience was not wholly
satisfying.

david rush
-- 
Christianity has not been tried and found wanting; it has been found
difficult and not tried.
	-- G.K. Chesterton