exception semantics

John W. Sarkela sarkela at sbcglobal.net
Thu Jan 16 14:57:28 UTC 2003


We built a set of unit tests for exceptions as part of Squeak World 
Tour.
I'll dig through my backups and see what I can find. It should certainly
be extended to look for this one...

John

On Thursday, January 16, 2003, at 06:42 AM, Stephen Pair wrote:

> 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