semantics of Exception>>outer ?
Anthony Hannan
ajhannan at yahoo.com
Fri Jun 27 18:31:34 UTC 2003
What is the behavior of #outer if there is no outer handler. Execute
#defaultAction? But this usually resumes from the signal.
John Brant <brant at refactory.com> wrote:
> #outer and #pass are different according to the ANSI standard. When an
> exception is resumed from an outer, the resumption occurs at the #outer
> message send, not the original #signal. For example, consider
>
> outer :
> [Notification signal. 4]
> on: Notification
> do: [:ex | ex outer. ex return: 5]
>
> pass :
> [Notification signal. 4]
> on: Notification
> do: [:ex | ex pass. ex return: 5]
>
> In the first example, the resume occurs for the "ex outer" statement so the
> "ex return: 5" is executed and the overall expression returns 5 (according
> to ANSI). However, in the second, the resume occurs for the "Notification
> signal" and "4" is returned. If the exception isn't resumable, then they
> should behave the same.
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
More information about the Squeak-dev
mailing list
|