The Trunk: System-mt.1159.mcz

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

The Trunk: System-mt.1159.mcz

commits-2
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1159.mcz

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

Name: System-mt.1159
Author: mt
Time: 17 May 2020, 4:21:47.664702 pm
UUID: 295e0b7d-6603-ca4e-b7b7-9152cd3d4678
Ancestors: System-mt.1158

Adds way to locate all stores into global variables. Expands documentation a little bit.

(Note that I am not sure whether it is a good idea to have this duplication in #allStoresInto:from:. Try

SystemNavigation default
        browseAllStoresInto: 'Display'
        from: ProtoObject

Maybe that addition with SharedPool was once a now obsolete workaround?)

=============== Diff against System-mt.1158 ===============

Item was added:
+ ----- Method: SystemNavigation>>allStoresInto: (in category 'query') -----
+ allStoresInto: globalVarName
+ "Answer a collection of method references for all methods in the current environment that assign to the globalVarName. Also supports variables from shared pools."
+ "self new allStoresInto: 'ActiveWorld'."
+
+ | result |
+ result := OrderedCollection new.
+ self allClasses do: [:class |
+ (class theNonMetaClass whichMethodsStoreInto: globalVarName) do: [:method |
+ result add: method methodReference].
+ (class theMetaClass whichMethodsStoreInto: globalVarName) do: [:method |
+ result add: method methodReference]].
+ ^result!

Item was changed:
  ----- Method: SystemNavigation>>allStoresInto:from: (in category 'query') -----
+ allStoresInto: varName from: aClass
+ "Answer a collection of method references for all the aClass' methods or any methods of a subclass/superclass that assign to the varName. If aClass is a SharedPool, consider all classes in the current environment that refer to that pool."
- allStoresInto: varName from: aClass
- "Answer a sequence of MewthodReferences for all the receiver's methods
- or any methods of a subclass/superclass that assign to the instance variable name."
  "self new allStoresInto: 'contents' from: Collection."
+ "self new allStoresInto: 'DayNames' from: ChronologyConstants."
+
  | result roots |
  result := OrderedCollection new.
  (aClass theNonMetaClass inheritsFrom: SharedPool) ifTrue:
  [roots := self allClasses select: [:class| class sharedPools includes: aClass theNonMetaClass].
   roots do:
  [:root|
  root withAllSubclassesDo:
  [:class|
  (class whichMethodsStoreInto: varName),
  (class class whichMethodsStoreInto: varName) do:
  [:eachMethod|
  result add: eachMethod methodReference]]]].
  aClass withAllSubAndSuperclassesDo:
  [ : class |
  (class theNonMetaClass whichMethodsStoreInto: varName),
  (class theMetaClass whichMethodsStoreInto: varName) do:
  [ : eachMethod |
  result add: eachMethod methodReference ] ].
  ^result!

Item was added:
+ ----- Method: SystemNavigation>>browseAllStoresInto: (in category 'browse') -----
+ browseAllStoresInto: globalVarName
+ "Create and schedule a Message Set browser for all the methods in the current environment that assign to the globalVarName. Also supports variables from shared pools."
+ "self new browseAllStoresInto: 'ActiveWorld'."
+
+ ^ self
+ browseMessageList: (self allStoresInto: globalVarName)
+ name: 'Stores into global ' , globalVarName
+ autoSelect: globalVarName!

Item was changed:
  ----- Method: SystemNavigation>>browseAllStoresInto:from: (in category 'browse') -----
  browseAllStoresInto: varName from: aClass
+ "Create and schedule a Message Set browser for all the aClass' methods or any methods of a subclass/superclass that assign to the varName. If aClass is a SharedPool, consider all classes in the current environment that refer to that pool."
- "Create and schedule a Message Set browser for all the receiver's methods
- or any methods of a subclass/superclass that refer to the instance variable name."
  "self new browseAllStoresInto: 'contents' from: Collection."
+ "self new browseAllStoresInto: 'DayNames' from: ChronologyConstants."
+
  ^ self
  browseMessageList: (self allStoresInto: varName from: aClass)
  name: 'Stores into ' , varName
  autoSelect: varName!