[squeak-dev] The Inbox: Kernel-fbs.734.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 30 12:30:07 UTC 2013


Frank Shearar uploaded a new version of Kernel to project The Inbox:
http://source.squeak.org/inbox/Kernel-fbs.734.mcz

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

Name: Kernel-fbs.734
Author: fbs
Time: 30 January 2013, 12:29:05.829 pm
UUID: ef47c409-cc2c-4e5f-a903-d71ead6268e5
Ancestors: Kernel-fbs.733

Implement Eliot's suggestions:
* make the throwing of a NotImplementedError the standard behvaiour for these related selectors;
* I went with "exceptionMessage" rather than "messageException" because the latter sounds like something that returns an exception.
* Pulled asMessageSend out because it makes the caseOf: easier to read and (YAGNI alert) it's more generally useful.

=============== Diff against Kernel-fbs.733 ===============

Item was added:
+ ----- Method: ContextPart>>asMessageSend (in category 'converting') -----
+ asMessageSend
+ 	| sender selector args |
+ 	sender := self sender.
+ 	selector := sender method selector.
+ 	args := Array new: selector numArgs.
+ 	1 to: selector numArgs do: [ :i | args at: i put: (sender tempAt: i)].
+ 	^ MessageSend receiver: self receiver selector: selector arguments: args.!

Item was added:
+ ----- Method: ContextPart>>exceptionMessage (in category 'accessing') -----
+ exceptionMessage
+ 	^ self selector caseOf: {
+ 			[#doesNotUnderstand:] -> [self tempAt: 1].
+ 			[#subclassResponsibility] -> [self asMessageSend]}
+ 		otherwise: [self error: 'This context is not the result of a message exception.'].!

Item was removed:
- ----- Method: ContextPart>>invocationMessage (in category 'accessing') -----
- invocationMessage
- 	"Upon sending messages like #doesNotUnderstand: or #subclassResponsibility - methods that will pop up a Debugger - return the Message that prompted the Debugger."
- 	| sender selector args |
- 	(self method selector == #doesNotUnderstand:) ifTrue: [^ self tempAt: 1].
- 	sender := self sender.
- 	selector := sender method selector.
- 	args := Array new: selector numArgs.
- 	1 to: selector numArgs do: [ :i | args at: i put: (sender tempAt: i)].
- 	^ MessageSend receiver: self receiver selector: selector arguments: args.!

Item was changed:
  ----- Method: Object>>shouldBeImplemented (in category 'error handling') -----
  shouldBeImplemented
  	"Announce that this message should be implemented"
  
+ 	NotImplementedError signal: ('{1} or a superclass should implement {2}' format: {self className. thisContext sender selector})!
- 	self error: 'This message should be implemented'!

Item was changed:
  ----- Method: Object>>shouldNotImplement (in category 'error handling') -----
  shouldNotImplement
  	"Announce that, although the receiver inherits this message, it should 
  	not implement it."
  
+ 	NotImplementedError signal: ('{1} is not a message appropriate for a {2}' format: {thisContext sender selector. self className}).!
- 	self error: 'This message is not appropriate for this object'!



More information about the Squeak-dev mailing list