About use of specific error
Andreas Raab
andreas.raab at gmx.de
Fri Mar 3 23:22:39 UTC 2006
Peter Crowther wrote:
> Java has had exceptions since the language was devised.
> In Smalltalk, and especially in Squeak, exceptions are
> recent additions. I suspect the reason that Smalltalk error
> handling has grown up the way it has, with variants of methods
> that don't throw the exception, is because error: didn't give
> the option of handling the problem - your code simply failed.
> A Squeak exception hierarchy has not been constructed because
> we're still moving over from a 30-year-old legacy of throwing
> the user into the debugger rather than handling the exception
> somewhere in the call stack.
I'm not sure I buy that. By your claim it should be the case that
instead of:
map at: key ifAbsent:["something"]
one would use something like
[map at: key] on: KeyNotFoundError do:[:ex| ex return: "something"].
Personally, I really don't want to move over to the latter style.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|