[squeak-dev] The Trunk: Kernel-nice.1427.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Nov 28 17:42:45 UTC 2021

Nicolas Cellier uploaded a new version of Kernel to project The Trunk:

==================== Summary ====================

Name: Kernel-nice.1427
Author: nice
Time: 28 November 2021, 6:42:41.820989 pm
UUID: 6681ef5b-1b4a-42e1-95cf-ac56a7757b58
Ancestors: Kernel-ct.1426, Kernel-eem.1426

Merge Kernel-ct.1426, Kernel-eem.1426

=============== Diff against Kernel-ct.1426 ===============

Item was added:
+ ----- Method: Message>>hasIdenticalContentsAs: (in category 'comparing') -----
+ hasIdenticalContentsAs: aMessage
+ 	"Answer if the argument's selector and arguments are identically equal to those of the receiver.
+ 	 It is assumed that the argument aMessage is, in fact, a message."
+        selector ~~ aMessage selector ifTrue:
+ 		[^false].
+ 	1 to: args size do:
+ 		[:i| (args at: i) ~~ (aMessage arguments at: i) ifTrue: [^false]].
+ 	^true!

Item was changed:
  ----- Method: Object>>doesNotUnderstand: (in category 'error handling') -----
  doesNotUnderstand: aMessage 
  	 "Handle the fact that there was an attempt to send the given
  	  message to the receiver but the receiver does not understand
  	  this message (typically sent from the machine when a message
+ 	  is sent to the receiver and no method is defined for that selector).
- 	 is sent to the receiver and no method is defined for that selector)."
+ 	 Raise the MessageNotUnderstood signal.  If it is caught, answer
+ 	 the result supplied by the exception handler.  If it is not caught,
+ 	 answer the result of resending the message within a guard for
+ 	 infinite recursion. This allows, for example, the programmer to
+ 	 implement the method and continue."
  	"Testing: (3 activeProcess)"
  	| exception resumeValue |
  	(exception := MessageNotUnderstood new)
  		message: aMessage;
  		receiver: self.
  	resumeValue := exception signal.
+ 	^exception reachedDefaultHandler "i.e. exception was not caught..."
+ 		ifTrue:
+ 			[[aMessage sentTo: self]
+ 				on: MessageNotUnderstood
+ 				do: [:ex|
+ 					(self == ex receiver
+ 					and: [aMessage hasIdenticalContentsAs: ex message]) ifFalse:
+ 						[ex pass].
+ 					self error: 'infinite recursion in doesNotUnderstand:']]
- 	^exception reachedDefaultHandler
- 		ifTrue: [aMessage sentTo: self]
  		ifFalse: [resumeValue]!

More information about the Squeak-dev mailing list