[squeak-dev] The Trunk: EToys-nice.292.mcz

H. Hirzel hannes.hirzel at gmail.com
Sun Oct 8 23:03:34 UTC 2017


Thank you Tobias, for this.

contrariwise to what I wrote earlier

   #initKnownRenames

is not a hack but part of the regular conversion process.

'renamed' is an instance variable used in the #mapClass method you refer to.

The comment says ' allow for premapping'


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"


-----------------

So the  question is :

Can we handle the replacement

    #MultiNewParagraph --> #NewParagraph

with pre-mapping or do we need something more.





On 10/9/17, Tobias Pape <Das.Linux at gmx.de> wrote:
>
>> On 09.10.2017, at 00:23, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>
>> There are no senders of
>>
>> #multiNewParagraphttfclpomsswfpp0
>
> Yes but look here ("> " form me, "..." left out)
> SmartRefStream>>mapClass: incoming
> 	"..."
> 	| cls oldVer sel nm |
>
> 	nm := renamed at: incoming ifAbsent: [incoming].	"allow pre-mapping around
> collisions"
> 	"> nm = 'MultiNewParagraph'"
> 	"..."
> 	oldVer := self versionSymbol: (structures at: nm).
> 	"> (structure at: nm) = #(0 text textStyle firstCharacterIndex container
> lines positionWhenComposed offsetToEnd maxRightX selectionStart
> selectionStop wantsColumnBreaks focused presentationText presentationLines)"
> 	"> oldNer = 'ttfclpomsswfpp0' "
> 	sel := nm asString.
> 	sel at: 1 put: (sel at: 1) asLowercase.
> 	"sel = multiNewParagraph
> 	sel := sel, oldVer.	"i.e. #rectangleoc4"
> 	"sel = multiNewParagraphttfclpomsswfpp0"
> 	Symbol hasInterned: sel ifTrue: [:symb |
> 		(self class canUnderstand: sel asSymbol) ifTrue: [
> 			reshaped ifNil: [reshaped := Dictionary new].
> 			"> HERE IS THE SEND"
> 			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
>
> Also look at all the methods in the *-conversion categories:
>
> abstractStringx0
> alansTextPlusMorphbosfcebbmsopssrsggshtt0
> bookPageMorphbosfcepcbbfgcc0
> clippingMorphbosfcep0
> clippingMorphbosfcepc0
> componentLikeModelbosfcebbmsop0
> currentProjectRefactoringx0
> dropShadowMorphbosfces0
> layoutMorphbosfcepbbochvimol0
> layoutMorphbosfcepcbbochvimol0
> morphicEventtcbks0
> morphicSoundEventtcbkss0
> multiStringx0
> multiSymbolx0
> myMorphbosfce0
> newMorphicEventts0
> sMInstallationRegistryiim0
> sMMaintainableObjectimcunsucromrf0
> scrollControllermvslrrsmsms0
> transparentColorrcc0
> variableSpacerbosfcebb0
> worldMorphbosfcebbfgccpmcpbttloiairfidcuwhavcdsll0
>
> Best regards
> 	-Tobias
>
>
>>
>>
>> On 10/9/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>> Tobias refers to
>>>
>>> SmartRefStream>>multiNewParagraphttfclpomsswfpp0
>>>
>>>        ^ NewParagraph
>>>
>>>
>>> I wonder what
>>>
>>> #multiNewParagraphttfclpomsswfpp0 is about.
>>>
>>>
>>> Tobias, what do you mean by "shadow"
>>>
>>> "
>>> So 'presentationText' and  'presentationLines' will shadow 'caretRect'
>>> and 'showCaret'...
>>> "
>>>
>>> On 10/9/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>>> Screen shot
>>>>
>>>>  #initKnownRenames
>>>>
>>>> present in a non-etoys 5.0 image.
>>>>
>>>>
>>>> On 10/9/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>>>> On 10/8/17, Bob Arning <arning315 at comcast.net> wrote:
>>>>>> #convertToCurrentVersion:refStream: might be used to fix up such
>>>>>> problems
>>>>>
>>>>> Seems to be the regular way to do this whereas
>>>>>
>>>>> SmartRefStream>>initKnownRenames
>>>>>
>>>>> looks more like a hack. However it is not etoys specific as it is
>>>>> present in Squeak 5.0 (screen shot)
>>>>>
>>>>>
>>>>> #initKnownRenames  is called in
>>>>>
>>>>>
>>>>> SmartRefStream>>initShapeDicts
>>>>>
>>>>>
>>>>> It has a flag #bobconv
>>>>>
>>>>> Looks like unfinished business.  Bob, what would you see as the way
>>>>> forward?
>>>>>
>>>>> initShapeDicts
>>>>> 	"Initialize me. "
>>>>>
>>>>> 	self flag: #bobconv.	
>>>>>
>>>>> 	"These must stay constant.  When structures read in, then things can
>>>>> change."
>>>>> 	steady := {Array. Dictionary. Association. ByteString. SmallInteger.
>>>>> Character} asSet.
>>>>>
>>>>> 	renamed ifNil: [
>>>>> 		renamed := Dictionary new.  "(old class name symbol -> new class
>>>>> name)"
>>>>> 		renamedConv := Dictionary new "(oldClassNameSymbol ->
>>>>> conversionSelectorInNewClass)"
>>>>> 	].
>>>>> 	self initKnownRenames
>>>>>
>>>>>
>>>>>>
>>>>>> On 10/8/17 5:33 PM, Tobias Pape wrote:
>>>>>>> So 'presentationText' and  'presentationLines' will shadow
>>>>>>> 'caretRect'
>>>>>>> and
>>>>>>> 'showCaret'...
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>
>


More information about the Squeak-dev mailing list