The Inbox: Traits-jr.313.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Traits-jr.313.mcz

commits-2
A new version of Traits was added to project The Inbox:
http://source.squeak.org/inbox/Traits-jr.313.mcz

==================== 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') -----
  category
  "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).
  ^result!

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!