3 ms·
Exceptions aren't the only solution though. Conditions/restarts in common lisp seem to be a more powerful but similar alternative. One problem with exceptions
by grogers 16y ago
Exceptions aren't the only solution though. Conditions/restarts in common lisp seem to be a more powerful but similar alternative.
One problem with exceptions is that they can only be one deep. Ie. if you are executing the code invoked by handling an exception, what should happen if another exception gets thrown. Java says forget about the old exception (ie. lose information), C++ says crash. Maybe there is something in between?
With or without exceptions, being error-safe is still really hard. I find you have to think "transactionally". For every operation you perform you have to think about what you need to clean up if it fails, so you focus on specifying what you want to do, not how you want to do it.