Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.490.mcz ==================== Summary ==================== Name: System-eem.490 Author: eem Time: 16 July 2012, 5:02:11.416 pm UUID: 01bb33e7-ec31-4459-8785-fc8b5e63372b Ancestors: System-laza.489 Pharo/Marcus Denker's shutdown/startup list refactoring that provides add before, not just add after, and makes clear the adding direction when no ancestor is given. =============== Diff against System-laza.489 =============== Item was changed: + ----- Method: SmalltalkImage>>add:toList:after: (in category 'startup list') ----- - ----- Method: SmalltalkImage>>add:toList:after: (in category 'snapshot and quit') ----- add: aClass toList: startUpOrShutDownList after: predecessor "Add the name of aClass to the startUp or shutDown list. + Add it after the name of predecessor" - Add it after the name of predecessor, or at the end if predecessor is nil." + (Smalltalk globals includes: aClass) + ifFalse: [self error: aClass name , ' cannot be found in Smalltalk dictionary.']. + + "Add after predecessor, moving it if already there." + (Smalltalk globals includes: predecessor) + ifFalse: [self error: predecessor name , ' cannot be found in Smalltalk dictionary.']. + (startUpOrShutDownList includes: predecessor name) + ifFalse: [self error: predecessor name , ' cannot be found in the list.']. + startUpOrShutDownList remove: aClass name ifAbsent:[]. + startUpOrShutDownList add: aClass name after: predecessor name! - | name earlierName | - name := aClass name. - (self at: name ifAbsent: [nil]) == aClass ifFalse: - [self error: name , ' cannot be found in Smalltalk dictionary.']. - predecessor == nil - ifTrue: ["No-op if alredy in the list." - (startUpOrShutDownList includes: name) ifFalse: - [startUpOrShutDownList == StartUpList - ifTrue: ["Add to end of startUp list" - startUpOrShutDownList addLast: name] - ifFalse: ["Add to front of shutDown list" - startUpOrShutDownList addFirst: name]]] - ifFalse: ["Add after predecessor, moving it if already there." - earlierName := predecessor name. - (self at: earlierName) == predecessor ifFalse: - [self error: earlierName , ' cannot be found in Smalltalk dictionary.']. - (startUpOrShutDownList includes: earlierName) ifFalse: - [self error: earlierName , ' cannot be found in the list.']. - startUpOrShutDownList remove: name ifAbsent:[]. - startUpOrShutDownList add: name after: earlierName]! Item was added: + ----- Method: SmalltalkImage>>add:toList:before: (in category 'startup list') ----- + add: aClass toList: startUpOrShutDownList before: successor + "Add the name of aClass to the startUp or shutDown list. + Add it before the name of successor" + + (Smalltalk globals includes: aClass) + ifFalse: [self error: aClass name , ' cannot be found in Smalltalk dictionary.']. + + "Add before successor, moving it if already there." + (Smalltalk globals includes: successor) + ifFalse: [self error: successor name , ' cannot be found in Smalltalk dictionary.']. + (startUpOrShutDownList includes: successor name) + ifFalse: [self error: successor name , ' cannot be found in the list.']. + startUpOrShutDownList remove: aClass name ifAbsent: []. + startUpOrShutDownList add: aClass name before: successor name.! Item was changed: + ----- Method: SmalltalkImage>>addToShutDownList: (in category 'startup list') ----- - ----- Method: SmalltalkImage>>addToShutDownList: (in category 'snapshot and quit') ----- addToShutDownList: aClass "This will add a ref to this class at the BEGINNING of the shutDown list." + "No-op if already in the list." + + (ShutDownList includes: aClass name) ifFalse: [ShutDownList addFirst: aClass name]! - - self addToShutDownList: aClass after: nil! Item was added: + ----- Method: SmalltalkImage>>addToShutDownList:before: (in category 'startup list') ----- + addToShutDownList: aClass before: predecessor + + self add: aClass toList: ShutDownList before: predecessor! Item was changed: + ----- Method: SmalltalkImage>>addToStartUpList: (in category 'startup list') ----- - ----- Method: SmalltalkImage>>addToStartUpList: (in category 'snapshot and quit') ----- addToStartUpList: aClass "This will add a ref to this class at the END of the startUp list." + "No-op if already in the list." + (StartUpList includes: aClass name) ifFalse: [StartUpList addLast: aClass name]! - self addToStartUpList: aClass after: nil! Item was added: + ----- Method: SmalltalkImage>>addToStartUpList:before: (in category 'startup list') ----- + addToStartUpList: aClass before: predecessor + + self add: aClass toList: StartUpList before: predecessor! |
Free forum by Nabble | Edit this page |