exception semantics

Stephen Pair spair at acm.org
Thu Jan 16 14:42:58 UTC 2003


VW's behavior is correct.  You can add the following line to the
beginning of Exception>>pass

	handlerContext ifNotNil: [handlerContext tempAt: 3 put: true].

The complete method would then be:

Exception>>pass
	"Yield control to the enclosing exception action for the
receiver."
	| result |
	handlerContext ifNotNil: [handlerContext tempAt: 3 put: true].
	self setHandlerFrom: handlerContext sender.
	handlerContext == nil
		ifTrue:
			[result _ self defaultAction.
			self isResumable
				ifTrue: [self resume: result]
				ifFalse: [IllegalResumeAttempt signal]]
		ifFalse: [self handlerAction]

-----

WARNING!  I have not run any unit tests to verify that this change
doesn't break other Exception functionality...are there and Sunit suites
for testing the exception handling framework???

- Stephen


> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Avi Bryant
> Sent: Thursday, January 16, 2003 3:49 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: exception semantics
> 
> 
> The following code:
> 
> [[
> 	Notification signal.
> 	Transcript cr.
> 	Notification signal.
> 
>  ] on: Notification
>    do: [:n | Transcript cr; show: 'inner'.  n pass "or n signal"]
> 
> ] on: Notification
>   do: [:n | Transcript cr; show: 'outer'. n resume]
> 
> shows
> 
>  inner
>  outer
> 
>  outer
> 
> on the Transcript.  Is this a bug?  VW7 shows
> 
>  inner
>  outer
> 
>  inner
>  outer.
> 
> Whichever semantics are correct, can anyone suggest the best 
> way to emulate the VW7 behavior?
> 
> Avi
> 
> 
> 
> 




More information about the Squeak-dev mailing list