[Newbies] Re: exception handling lingo
mark at ociweb.com
Tue Sep 30 21:36:15 UTC 2008
On Sep 30, 2008, at 1:34 PM, nicolas cellier wrote:
> 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
Thanks! I think I understand all you said except for two things.
1) The ifCurtailed method. From just looking at the comment in the
method and the code, I have no idea what it does.
2) The reject method. Which class are you referring to? The ones I see
that contain that method don't seem related to exception handling.
More information about the Beginners