[Newbies] Re: exception handling lingo
nicolas cellier
ncellier at ifrance.com
Tue Sep 30 18:34:47 UTC 2008
Mark Volkmann a écrit :
> I asked this earlier, but it wasn't the first question in my email, so
> it may have been overlooked.
>
> In Smalltalk lingo is it correct to say "signal" and "handle" in place
> of Java's "throw" and "catch"?
>
> ---
> Mark Volkmann
He, nobody answering, seems you reached some kind of quota ;)
I would say, you mostly get it, but:
- in java/C++ etc... throw/catch try/catch are part of Syntax
- in Smalltalk, these are just ordinary messages sent to objects...
As such, you'll see some differences across dialects like #raise instead
of #signal for example...
Inside a Smalltalk dialect, you'll see also some variations (browse
usage of #signal: in Squeak for example).
Concerning #handle, i don't know where you get the information...
#handle:do: is a compatibility message dating from very old Visualworks
image and is not in Squeak images, AFAIK.
ANSI recommend using #on:do:
Also browse usage of simpler messages like #ensure: #ifCurtailed:
Also browse all possible handling actions like #reject #pass #retry
#return #retryWith: #return: #resignalAs:
Maybe you'll need some good tutorial to learn the differences between
these actions (remember that Smalltalk can handle the MethodContext call
stack, so don't be amazed of rich possibilities there).
Cheers
More information about the Beginners
mailing list