[squeak-dev] The Inbox: Traits-jr.313.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jun 3 21:31:25 UTC 2020

A new version of Traits was added to project The Inbox:

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

Name: Traits-jr.313
Author: jr
Time: 3 June 2020, 11:31:26.724983 pm
UUID: 9ae78e9a-e3da-7344-860d-e0d40818590e
Ancestors: Traits-pre.312

Look up category of a Trait in the correct environment if the Trait's home is not the default environment.

=============== Diff against Traits-pre.312 ===============

Item was changed:
  ----- Method: Trait>>category (in category 'accessing') -----
  	"Answer the system organization category for the receiver. First check whether the
  	category name stored in the ivar is still correct and only if this fails look it up
  	(latter is much more expensive)"
  	| result |
  	category ifNotNil: [ :symbol |
+ 		((environment organization listAtCategoryNamed: symbol) includes: self name)
- 		((SystemOrganization listAtCategoryNamed: symbol) includes: self name)
  			ifTrue: [ ^symbol ] ].
+ 	category := (result := environment organization categoryOfElement: self name).
- 	category := (result := SystemOrganization categoryOfElement: self name).

Item was changed:
  ----- Method: Trait>>category: (in category 'accessing') -----
  category: aString 
  	"Categorize the receiver under the system category, aString, removing it from 
  	any previous categorization."
  	| oldCategory |
  	oldCategory := category.
  	aString isString
  		ifTrue: [
  			category := aString asSymbol.
+ 			environment organization classify: self name under: category ]
- 			SystemOrganization classify: self name under: category ]
  		ifFalse: [self errorCategoryName].
  	SystemChangeNotifier uniqueInstance
  		class: self recategorizedFrom: oldCategory to: category!

More information about the Squeak-dev mailing list