semantics of Exception>>outer ?

Anthony Hannan ajhannan at yahoo.com
Fri Jun 27 18:20:39 UTC 2003


Thanks John, I'll fix ContextCleanup-ajh accordingly.

John Brant <brant at refactory.com> wrote:
> > From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> > bounces at lists.squeakfoundation.org] On Behalf Of Anthony Hannan
> > 
> > I rewrote ifError: in ContextCleanup-ajh, and fixed #outer to report that
> > it is
> > deprecated because it is the same a #pass.  Or is it different?  At least
> > the
> > old code is equivalent.
> 
> They 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.
> 
> 
> John Brant


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the Squeak-dev mailing list