[V3dot9] about 3737 (condensechanges

Stéphane Ducasse stephane.ducasse at univ-savoie.fr
Thu Jun 22 07:23:30 UTC 2006


Hi

I did the following

But I got the error pavel reported so now we should look at it. :)
I will give a try to understand :)

Stef



moveChangesTo: newFile
	"Used in the process of condensing changes, this message requests that
	the source code of all methods of the receiver that have been changed
	should be moved to newFile."

     | changes |
     changes := self methodDict keys select: [:sel |
     (self compiledMethodAt: sel) fileIndex > 1 and: [
     (self includesLocalSelector: sel) or: [
     (self compiledMethodAt: sel) sendsToSuper]]].
     self fileOutChangedMessages: changes
     on: newFile
     moveSource: true
     toFile: 2



     | dict |
dict := IdentityDictionary new.
Smalltalk allClassesAndTraitsDo: [:class |
     | methodDict |
     Transcript show: class; cr.
     methodDict := IdentityDictionary new.	
     class methodDictionary keys do: [:m |
         methodDict at: m put: (class sourceCodeAt: m) ].
     dict at: class put: methodDict.

     methodDict := IdentityDictionary new.	
     class class methodDictionary keys do: [:m |
         methodDict at: m put: (class class sourceCodeAt: m) ].
     dict at: class class put: methodDict].

Smalltalk condenseChanges.

Smalltalk allClassesAndTraitsDo: [:class |
     | methodDict |
     class methodDictionary keys do: [:m |
         (((dict at: class) at: m) = (class sourceCodeAt: m))
             ifFalse: [
                 Transcript show: ('Failed: ', class name, ' >> ', m  
asString); cr. ]].
     class class methodDictionary keys do: [:m |
         (((dict at: class class) at: m) = (class class sourceCodeAt:  
m))
             ifFalse: [
                 Transcript show: ('Failed: ', class class name, ' >>  
', m asString); cr. ]]].


More information about the V3dot9 mailing list