David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.965.mcz ==================== Summary ==================== Name: System-dtl.965 Author: dtl Time: 13 October 2017, 11:38:38.184812 pm UUID: 710f2f23-7e87-4fbf-9a16-9b6df253f5bd Ancestors: System-tpr.964 Add flag to identify sender of composed selector #multiNewParagraphttfclpomsswfpp0 =============== Diff against System-tpr.964 =============== Item was changed: ----- Method: SmartRefStream>>mapClass: (in category 'read write') ----- mapClass: incoming "See if the old class named nm exists. If so, return it. If not, map it to a new class, and save the mapping in renamed. " | cls oldVer sel nm | self flag: #bobconv. nm := renamed at: incoming ifAbsent: [incoming]. "allow pre-mapping around collisions" (nm endsWith: ' class') ifFalse: [cls := Smalltalk at: nm ifAbsent: [nil]. cls ifNotNil: [^ cls]] "Known class. It will know how to translate the instance." ifTrue: [cls := Smalltalk at: nm substrings first asSymbol ifAbsent: [nil]. cls ifNotNil: [^ cls class]]. "Known class. It will know how to translate the instance." oldVer := self versionSymbol: (structures at: nm). sel := nm asString. sel at: 1 put: (sel at: 1) asLowercase. sel := sel, oldVer. "i.e. #rectangleoc4" + self flag: #multiNewParagraphttfclpomsswfpp0. "identify senders of multiNewParagraphttfclpomsswfpp0" Symbol hasInterned: sel ifTrue: [:symb | (self class canUnderstand: sel asSymbol) ifTrue: [ reshaped ifNil: [reshaped := Dictionary new]. cls := self perform: sel asSymbol]]. "This class will take responsibility" cls ifNil: [cls := self writeClassRenameMethod: sel was: nm fromInstVars: (structures at: nm). cls isString ifTrue: [cls := nil]]. cls ifNotNil: [renamed at: nm put: cls name]. ^ cls ! |
> On 14.10.2017, at 05:38, [hidden email] wrote: > > David T. Lewis uploaded a new version of System to project The Trunk: > http://source.squeak.org/trunk/System-dtl.965.mcz > > ==================== Summary ==================== > > Name: System-dtl.965 > Author: dtl > Time: 13 October 2017, 11:38:38.184812 pm > UUID: 710f2f23-7e87-4fbf-9a16-9b6df253f5bd > Ancestors: System-tpr.964 > > Add flag to identify sender of composed selector #multiNewParagraphttfclpomsswfpp0 Just curious, why? > > =============== Diff against System-tpr.964 =============== > > Item was changed: > ----- Method: SmartRefStream>>mapClass: (in category 'read write') ----- > mapClass: incoming > "See if the old class named nm exists. If so, return it. If not, map it to a new class, and save the mapping in renamed. " > > | cls oldVer sel nm | > > self flag: #bobconv. > > > nm := renamed at: incoming ifAbsent: [incoming]. "allow pre-mapping around collisions" > (nm endsWith: ' class') > ifFalse: [cls := Smalltalk at: nm ifAbsent: [nil]. > cls ifNotNil: [^ cls]] "Known class. It will know how to translate the instance." > ifTrue: [cls := Smalltalk at: nm substrings first asSymbol ifAbsent: [nil]. > cls ifNotNil: [^ cls class]]. "Known class. It will know how to translate the instance." > oldVer := self versionSymbol: (structures at: nm). > sel := nm asString. > sel at: 1 put: (sel at: 1) asLowercase. > sel := sel, oldVer. "i.e. #rectangleoc4" > + self flag: #multiNewParagraphttfclpomsswfpp0. "identify senders of multiNewParagraphttfclpomsswfpp0" > Symbol hasInterned: sel ifTrue: [:symb | > (self class canUnderstand: sel asSymbol) ifTrue: [ > reshaped ifNil: [reshaped := Dictionary new]. > cls := self perform: sel asSymbol]]. "This class will take responsibility" > cls ifNil: [cls := self writeClassRenameMethod: sel was: nm > fromInstVars: (structures at: nm). > cls isString ifTrue: [cls := nil]]. > cls ifNotNil: [renamed at: nm put: cls name]. > ^ cls > ! > > |
I see it is a help to understand the code.
Alternatively the comment of class SmartRefStream could be improved to explain these 'weird' looking method names such as #multiNewParagraphttfclpomsswfpp0 On 10/14/17, Tobias Pape <[hidden email]> wrote: > >> On 14.10.2017, at 05:38, [hidden email] wrote: >> >> David T. Lewis uploaded a new version of System to project The Trunk: >> http://source.squeak.org/trunk/System-dtl.965.mcz >> >> ==================== Summary ==================== >> >> Name: System-dtl.965 >> Author: dtl >> Time: 13 October 2017, 11:38:38.184812 pm >> UUID: 710f2f23-7e87-4fbf-9a16-9b6df253f5bd >> Ancestors: System-tpr.964 >> >> Add flag to identify sender of composed selector >> #multiNewParagraphttfclpomsswfpp0 > > Just curious, why? > >> >> =============== Diff against System-tpr.964 =============== >> >> Item was changed: >> ----- Method: SmartRefStream>>mapClass: (in category 'read write') ----- >> mapClass: incoming >> "See if the old class named nm exists. If so, return it. If not, map >> it to a new class, and save the mapping in renamed. " >> >> | cls oldVer sel nm | >> >> self flag: #bobconv. >> >> >> nm := renamed at: incoming ifAbsent: [incoming]. "allow pre-mapping >> around collisions" >> (nm endsWith: ' class') >> ifFalse: [cls := Smalltalk at: nm ifAbsent: [nil]. >> cls ifNotNil: [^ cls]] "Known class. It will know how to translate >> the instance." >> ifTrue: [cls := Smalltalk at: nm substrings first asSymbol ifAbsent: >> [nil]. >> cls ifNotNil: [^ cls class]]. "Known class. It will know how to >> translate the instance." >> oldVer := self versionSymbol: (structures at: nm). >> sel := nm asString. >> sel at: 1 put: (sel at: 1) asLowercase. >> sel := sel, oldVer. "i.e. #rectangleoc4" >> + self flag: #multiNewParagraphttfclpomsswfpp0. "identify senders of >> multiNewParagraphttfclpomsswfpp0" >> Symbol hasInterned: sel ifTrue: [:symb | >> (self class canUnderstand: sel asSymbol) ifTrue: [ >> reshaped ifNil: [reshaped := Dictionary new]. >> cls := self perform: sel asSymbol]]. "This class will take >> responsibility" >> cls ifNil: [cls := self writeClassRenameMethod: sel was: nm >> fromInstVars: (structures at: nm). >> cls isString ifTrue: [cls := nil]]. >> cls ifNotNil: [renamed at: nm put: cls name]. >> ^ cls >> ! >> >> > > > |
An explanation where and how
ttfclpomsswfpp0 is constructed. On 10/14/17, H. Hirzel <[hidden email]> wrote: > I see it is a help to understand the code. > > Alternatively the comment of class SmartRefStream could be improved to > explain these 'weird' looking method names such as > > #multiNewParagraphttfclpomsswfpp0 > > On 10/14/17, Tobias Pape <[hidden email]> wrote: >> >>> On 14.10.2017, at 05:38, [hidden email] wrote: >>> >>> David T. Lewis uploaded a new version of System to project The Trunk: >>> http://source.squeak.org/trunk/System-dtl.965.mcz >>> >>> ==================== Summary ==================== >>> >>> Name: System-dtl.965 >>> Author: dtl >>> Time: 13 October 2017, 11:38:38.184812 pm >>> UUID: 710f2f23-7e87-4fbf-9a16-9b6df253f5bd >>> Ancestors: System-tpr.964 >>> >>> Add flag to identify sender of composed selector >>> #multiNewParagraphttfclpomsswfpp0 >> >> Just curious, why? >> >>> >>> =============== Diff against System-tpr.964 =============== >>> >>> Item was changed: >>> ----- Method: SmartRefStream>>mapClass: (in category 'read write') >>> ----- >>> mapClass: incoming >>> "See if the old class named nm exists. If so, return it. If not, map >>> it to a new class, and save the mapping in renamed. " >>> >>> | cls oldVer sel nm | >>> >>> self flag: #bobconv. >>> >>> >>> nm := renamed at: incoming ifAbsent: [incoming]. "allow pre-mapping >>> around collisions" >>> (nm endsWith: ' class') >>> ifFalse: [cls := Smalltalk at: nm ifAbsent: [nil]. >>> cls ifNotNil: [^ cls]] "Known class. It will know how to >>> translate >>> the instance." >>> ifTrue: [cls := Smalltalk at: nm substrings first asSymbol ifAbsent: >>> [nil]. >>> cls ifNotNil: [^ cls class]]. "Known class. It will know how to >>> translate the instance." >>> oldVer := self versionSymbol: (structures at: nm). >>> sel := nm asString. >>> sel at: 1 put: (sel at: 1) asLowercase. >>> sel := sel, oldVer. "i.e. #rectangleoc4" >>> + self flag: #multiNewParagraphttfclpomsswfpp0. "identify senders of >>> multiNewParagraphttfclpomsswfpp0" >>> Symbol hasInterned: sel ifTrue: [:symb | >>> (self class canUnderstand: sel asSymbol) ifTrue: [ >>> reshaped ifNil: [reshaped := Dictionary new]. >>> cls := self perform: sel asSymbol]]. "This class will take >>> responsibility" >>> cls ifNil: [cls := self writeClassRenameMethod: sel was: nm >>> fromInstVars: (structures at: nm). >>> cls isString ifTrue: [cls := nil]]. >>> cls ifNotNil: [renamed at: nm put: cls name]. >>> ^ cls >>> ! >>> >>> >> >> >> > |
In reply to this post by Tobias Pape
If you search for senders of multiNewParagraphttfclpomsswfp One way to fix this is mentioning this symbol in the mapClass: method. A better way would be to mark the method as sender of *all* conversion methods. Which I just did in System-bf.966 :) - Bert - |
In reply to this post by Hannes Hirzel
An explanation where and how It's the initials of all instance variables followed by the class version integer. The initials allow to detect most changes to the instance variables, but if this is not sufficient (perhaps because the new var had the same initial, or the vars did not change in name at all) we still have the class version. Most classes are still at version 0, but if you check implementers of classVersion you can find a few that were incremented to force a conversion on load. - Bert - |
Thank you for the explanation. The following note should find it's way
into the class comment. <note> How are selectors ending with something like ttfclpomsswfpp0 constructed and what does it mean? Answer: It is the initials of all instance variables followed by the class version integer. The initials allow to detect most changes to the instance variables, but if this is not sufficient (perhaps because the new var had the same initial, or the vars did not change in name at all) we still have the class version. Most classes are still at version 0, but if you check implementers of classVersion you can find a few that were incremented to force a conversion on load. </note> On 10/14/17, Bert Freudenberg <[hidden email]> wrote: > On Sat, Oct 14, 2017 at 11:37 AM, H. Hirzel <[hidden email]> > wrote: > >> An explanation where and how >> >> ttfclpomsswfpp0 >> >> is constructed. > > > It's the initials of all instance variables followed by the class version > integer. The initials allow to detect most changes to the instance > variables, but if this is not sufficient (perhaps because the new var had > the same initial, or the vars did not change in name at all) we still have > the class version. > > Most classes are still at version 0, but if you check implementers > of classVersion you can find a few that were incremented to force a > conversion on load. > > - Bert - > |
Could you please commit
System-hjh.967 ? On 10/14/17, H. Hirzel <[hidden email]> wrote: > Thank you for the explanation. The following note should find it's way > into the class comment. > > <note> > > How are selectors ending with something like > > ttfclpomsswfpp0 > > constructed and what does it mean? > > > Answer: > It is the initials of all instance variables followed by the class > version integer. The initials allow to detect most changes to the > instance variables, but if this is not sufficient (perhaps because the > new var had the same initial, or the vars did not change in name at > all) we still have the class version. > > Most classes are still at version 0, but if you check implementers of > classVersion you can find a few that were incremented to force a > conversion on load. > > </note> > > On 10/14/17, Bert Freudenberg <[hidden email]> wrote: >> On Sat, Oct 14, 2017 at 11:37 AM, H. Hirzel <[hidden email]> >> wrote: >> >>> An explanation where and how >>> >>> ttfclpomsswfpp0 >>> >>> is constructed. >> >> >> It's the initials of all instance variables followed by the class >> version >> integer. The initials allow to detect most changes to the instance >> variables, but if this is not sufficient (perhaps because the new var had >> the same initial, or the vars did not change in name at all) we still >> have >> the class version. >> >> Most classes are still at version 0, but if you check implementers >> of classVersion you can find a few that were incremented to force a >> conversion on load. >> >> - Bert - >> > |
Free forum by Nabble | Edit this page |