<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi Tony.<div><br></div><div>I suppose that the idea was that every environment has its own system organization. By adding a back reference from organization to environment, there is still no support of "multiple" environments. Do you plan to change this dynamically? If so, why? :-) Would you sketch an example?</div><div><br></div><div>Best,</div><div>Marcel</div><div><br></div><div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 29.03.2021 10:23:41 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Tony Garnock-Jones uploaded a new version of System to project The Trunk:<br>http://source.squeak.org/trunk/System-tonyg.1224.mcz<br><br>==================== Summary ====================<br><br>Name: System-tonyg.1224<br>Author: tonyg<br>Time: 29 March 2021, 10:15:02.279821 am<br>UUID: 9d897d72-46fc-4205-a27b-89c7a50ac104<br>Ancestors: System-mt.1223<br><br>Teach SystemOrganizer about multiple environments.<br><br>=============== Diff against System-mt.1223 ===============<br><br>Item was changed:<br> Categorizer subclass: #SystemOrganizer<br>+ instanceVariableNames: 'environment'<br>- instanceVariableNames: ''<br> classVariableNames: ''<br> poolDictionaries: ''<br> category: 'System-Support'!<br> <br> !SystemOrganizer commentStamp: '<historical>' prior: 0!<br> My instances provide an organization for the classes in the system, just as a ClassOrganizer organizes the messages within a class. The only difference is the methods for fileIn/Out.!<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>classesIn: (in category 'query') -----<br> classesIn: categoryName<br> <br> | classes |<br> classes := OrderedCollection new.<br> self categories withIndexCollect: [:cat :idx |<br> (categoryName match: cat)<br> ifTrue: [classes addAll: (self listAtCategoryNumber: idx)]<br> ifFalse: [nil]].<br>+ ^ classes collect: [:clsName | self environment classNamed: clsName]!<br>- ^ classes collect: [:clsName | Smalltalk classNamed: clsName]!<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>classify:under: (in category 'accessing') -----<br> classify: element under: newCategory<br> | oldCategory class |<br> self flag: #environments. "do we want notifications for classes in other environments?"<br> oldCategory := self categoryOfElement: element.<br> super classify: element under: newCategory.<br>+ class := self environment at: element ifAbsent: [^ self].<br>- class := Smalltalk at: element ifAbsent: [^ self].<br> self == SystemOrganization ifTrue: [<br> SystemChangeNotifier uniqueInstance<br> class: class<br> recategorizedFrom: oldCategory<br> to: newCategory]!<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>commentInventory: (in category 'query') -----<br> commentInventory: categoryName<br> <br> "SystemOrganization commentInventory: 'Morphic*'"<br> <br> | classes commentedClasses |<br> classes := OrderedCollection new.<br> self categories withIndexCollect: [:cat :idx |<br> (categoryName match: cat)<br> ifTrue: [classes addAll: (self listAtCategoryNumber: idx)]<br> ifFalse: [nil]].<br>+ commentedClasses := classes select: [:catCls | (self environment at: catCls) hasComment].<br>- commentedClasses := classes select: [:catCls | (Smalltalk at: catCls) hasComment].<br> ^ 'There are ' , classes size asString , ' classes in ' , categoryName ,<br> ' of which ' , commentedClasses size asString , ' have comments and ',<br> (classes size - commentedClasses size) asString , ' do not yet have comments.'<br> !<br><br>Item was added:<br>+ ----- Method: SystemOrganizer>>environment (in category 'accessing') -----<br>+ environment<br>+ ^ environment ifNil: [Smalltalk globals]!<br><br>Item was added:<br>+ ----- Method: SystemOrganizer>>environment: (in category 'accessing') -----<br>+ environment: anEnvironment<br>+ environment := anEnvironment!<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>fileOutCategory:on:initializing: (in category 'fileIn/Out') -----<br> fileOutCategory: category on: aFileStream initializing: aBool<br> "Store on the file associated with aFileStream, all the traits and classes associated <br> with the category and any requested shared pools in the right order."<br> <br> | first poolSet tempClass classes traits |<br> traits := self orderedTraitsIn: category.<br> classes := self superclassOrder: category.<br> poolSet := Set new.<br> classes do: [:class | class sharedPools do: [:eachPool | poolSet add: eachPool]].<br> poolSet size > 0 ifTrue: [<br> tempClass := Class new.<br> tempClass shouldFileOutPools ifTrue: [<br> poolSet := poolSet select: [:aPool |<br>+ tempClass shouldFileOutPool: (self environment keyAtIdentityValue: aPool)].<br>- tempClass shouldFileOutPool: (Smalltalk globals keyAtIdentityValue: aPool)].<br> poolSet do: [:aPool | tempClass fileOutPool: aPool onFileStream: aFileStream]]].<br> first := true.<br> traits, classes do: [:each | <br> first<br> ifTrue: [first := false]<br> ifFalse: [aFileStream cr; nextPut: Character newPage; cr].<br> each<br> fileOutOn: aFileStream<br> moveSource: false<br> toFile: 0<br> initializing: false].<br> aBool ifTrue: [classes do: [:cls | cls fileOutInitializerOn: aFileStream]].!<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>orderedTraitsIn: (in category 'fileIn/Out') -----<br> orderedTraitsIn: category <br> "Answer an OrderedCollection containing references to the traits in the <br> category whose name is the argument, category (a string). The traits <br> are ordered so they can be filed in."<br> <br> | behaviors traits |<br> behaviors := (self listAtCategoryNamed: category asSymbol) <br>+ collect: [:title | self environment at: title].<br>- collect: [:title | Smalltalk at: title].<br> traits := behaviors reject: [:each | each isBehavior].<br> ^traits asArray sort: [:t1 :t2 |<br> (t2 traitComposition allTraits includes: t1)<br> or: [(t1 traitComposition allTraits includes: t2) not]]!<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>removeMissingClasses (in category 'remove') -----<br> removeMissingClasses<br> "Remove any class names that are no longer in the Smalltalk dictionary. Used for cleaning up after garbage collecting user-generated classes."<br> "SystemOrganization removeMissingClasses"<br> <br> elementArray copy do: [:el |<br>+ (self environment includesKey: el) ifFalse: [self removeElement: el]].<br>- (Smalltalk includesKey: el) ifFalse: [self removeElement: el]].<br> !<br><br>Item was changed:<br> ----- Method: SystemOrganizer>>superclassOrder: (in category 'fileIn/Out') -----<br> superclassOrder: category <br> "Answer an OrderedCollection containing references to the classes in the <br> category whose name is the argument, category (a string). The classes <br> are ordered with superclasses first so they can be filed in."<br> <br> | behaviors classes |<br> behaviors := (self listAtCategoryNamed: category asSymbol) <br>+ collect: [:title | self environment at: title].<br>- collect: [:title | Smalltalk at: title].<br> classes := behaviors select: [:each | each isBehavior].<br> ^ChangeSet superclassOrder: classes!<br><br><br></historical></div></blockquote></div>