[squeak-dev] The Inbox: Tools-ct.945.mcz

Levente Uzonyi leves at caesar.elte.hu
Tue Feb 25 10:35:44 UTC 2020


Hi Christoph,

I still feel like using #ifNil:, #ifNotNil: in a cascade is not right.
In this case, having  #yourself inside the #ifNotNil: block looks more 
natural to me:

 	^(self browseVersionsOf: aCompiledMethod) ifNotNil: [:browser |
 		browser
 			selectMethod: aCompiledMethod;
 			yourself ]


Levente

On Mon, 24 Feb 2020, commits at source.squeak.org wrote:

> Christoph Thiede uploaded a new version of Tools to project The Inbox:
> http://source.squeak.org/inbox/Tools-ct.945.mcz
>
> ==================== Summary ====================
>
> Name: Tools-ct.945
> Author: ct
> Time: 24 February 2020, 1:56:51.392323 pm
> UUID: cc577466-ca48-484b-9454-11ae7ffde0b2
> Ancestors: Tools-mt.940
>
> Fixes a bug/unnecessary limitation in VersionsBrowser class >> #browseMethod: that raised an error when browsing a method that had been removed from the system.
>
> You can also reproduce it via: thisContext method browse "on a fresh image".
>
> This commit replaces Tools-ct.944, which has been refactored again to reuse the return carat according to Kent Beck ("Format conditionals so their value is used where it clearly expresses the intent of the method"). Thanks to Chris for the reminder!
>
> =============== Diff against Tools-mt.940 ===============
>
> Item was changed:
>  ----- Method: VersionsBrowser class>>browseMethod: (in category 'instance creation') -----
>  browseMethod: aCompiledMethod
> 
> + 	^ (self browseVersionsOf: aCompiledMethod)
> + 		ifNotNil: [:browser |
> + 			browser selectMethod: aCompiledMethod];
> - 	^ (self browseVersionsForClass: aCompiledMethod methodClass selector: aCompiledMethod selector)
> - 		selectMethod: aCompiledMethod;
>  		yourself!
>
> Item was added:
> + ----- Method: VersionsBrowser class>>browseVersionsOf: (in category 'instance creation') -----
> + browseVersionsOf: aCompiledMethod
> + 
> + 	| methodClass methodSelector |
> + 	methodClass := aCompiledMethod methodClass.
> + 	methodSelector := aCompiledMethod selector.
> + 	^ self
> + 		browseVersionsOf: aCompiledMethod
> + 		class: methodClass
> + 		meta: methodClass isMeta
> + 		category: (methodClass organization categoryOfElement: methodSelector)
> + 		selector: methodSelector!


More information about the Squeak-dev mailing list