I was wondering what is the amount of work to add traits support.
The problem is that I do not have a big picture about all the palyer:
classDecorator, classEditor....
It does not look complex but I'm ill so comment and a class diagram
would help.
Stef
Why there is no common superclass?
Behavior subclass: #MetaclassEditor
instanceVariableNames: 'editor superEditor instVarNames methods
organization traitComposition'
classVariableNames: ''
poolDictionaries: ''
category: 'SystemEditor-Editors'
Object subclass: #ClassEditor
instanceVariableNames: 'subject product system superEditor name type
instVarNames classVarNames sharedPools methods category organization
properties decorators'
classVariableNames: 'ReservedNames'
poolDictionaries: ''
category: 'SystemEditor-Editors'
initialize
migrators := OrderedCollection new.
super initialize would not hurt
edPrepareMigration: txn for: aClassEditor
txn addMigrator: (ObjectMigrator
origin: self subject
destination: (self buildFor:
aClassEditor)).
(additions isEmpty and: [removals isEmpty]) ifFalse: [aClassEditor
organization].
tnx?
and a comment?
at: aSymbol ifAbsent: absentBlock
(removals includes: aSymbol) ifTrue: [^ absentBlock value].
additions at: aSymbol ifPresent: [:editor | ^ editor].
self subject at: aSymbol ifPresent: [:aCompiledMethod | ^ self add:
(MethodEditor
source: (classEditor subject sourceCodeAt: aSymbol)
classified: (classEditor organization subject categoryOfElement:
aSymbol)
stamp: aCompiledMethod timeStamp
notifying: nil
logging: true )].
^ absentBlock value
may be a better formatting would help
setSubject: aClass system: aSystemEditor
subject := aClass.
system := aSystemEditor.
subject ifNil:
[superEditor := aSystemEditor at: #Object.
name := #Annonymous.
type := #normal.
instVarNames := Array new.
classVarNames := Array new.
sharedPools := Array new.
methods := MethodDictionaryEditor for: self.
self class edInitializeForNewClass].
decorators := ClassDecorator decoratorsFor: self.
I was wondering when a class would be nil.
So the logic should be mentioned somewhere.
subclass: aSymbol instanceVariableNames: instString
classVariableNames: classString poolDictionaries: poolString category:
categoryString
^ ((system
at: aSymbol
ifAbsent: [ ClassEditor on: nil for: system])
edName: aSymbol
superclassEditor: self
type: #normal
instVarString: instString
classVarString: classString
poolImports: poolString
category: categoryString) edRegisterEditor
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project