Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
valuesportinglog [2022/01/31 12:48] christian [Undeclared class references] |
valuesportinglog [2022/02/01 13:29] christian [FileIn 7 - Tests] |
||
---|---|---|---|
Line 120: | Line 120: | ||
FileOut from VW, then fileIn into a fresh Squeak image. | FileOut from VW, then fileIn into a fresh Squeak image. | ||
- | Loads about 80% until it hits the error that ColorValue | + | Loads about 85% until it hits the error that GeneralBindingReference |
The Transcript shows: | The Transcript shows: | ||
<code Smalltalk> | <code Smalltalk> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
</ | </ | ||
+ | |||
+ | Since GeneralBindingReference is specific to namespaces in VW, we don't need to port the class extension methods. For this we add the class to the **# | ||
+ | |||
+ | <code Smalltalk> | ||
+ | ^PackageChange | ||
+ | unusedClasses: | ||
+ | newSuperclasses: | ||
+ | hierarchyChanges: | ||
+ | classReference: | ||
+ | classChanges: | ||
+ | localChanges: | ||
+ | </ | ||
+ | |||
+ | Published as **[Squeak Fileout PDFtalk] (3.0.0.5, | ||
+ | |||
+ | ===== FileIn 4 ===== | ||
+ | |||
+ | FileOut from VW, then fileIn into a fresh Squeak image. | ||
+ | |||
+ | Loads about 97% until it hits the error that Timestamp is not defined. | ||
+ | |||
+ | The Transcript shows: | ||
+ | <code Smalltalk> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
+ | UndefinedObject>> | ||
+ | </ | ||
+ | |||
+ | We do the same trick as in FileIn x and set DateAndTime as superclass of Timestamp. The new Transformation is: | ||
+ | |||
+ | <code Smalltalk> | ||
+ | ValuesTransform | ||
+ | ^PackageChange | ||
+ | unusedClasses: | ||
+ | newSuperclasses: | ||
+ | with: # | ||
+ | with: # | ||
+ | hierarchyChanges: | ||
+ | classReference: | ||
+ | classChanges: | ||
+ | localChanges: | ||
+ | </ | ||
+ | |||
+ | Published as **[Squeak Fileout PDFtalk] (3.0.0.6, | ||
+ | |||
+ | ===== FileIn 5 ===== | ||
+ | |||
+ | FileOut from VW, then fileIn into a fresh Squeak image. | ||
+ | |||
+ | Loads without errors or warnings!. | ||
+ | |||
+ | < | ||
+ | First milestone: <span style=" | ||
+ | </ | ||
+ | |||
+ | Next step: fileIn the tests. | ||
+ | |||
+ | ===== FileIn 6 - Tests ===== | ||
+ | |||
+ | Added Squeak class method ''# | ||
+ | |||
+ | <code Smalltalk> | ||
+ | self | ||
+ | write: (' | ||
+ | pundles: (Array with: (Store.Registry packageNamed: | ||
+ | package: #' | ||
+ | prerequisites: | ||
+ | packageChanges: | ||
+ | </ | ||
+ | |||
+ | with the standard transformation for Value classes: | ||
+ | |||
+ | <code Smalltalk> | ||
+ | ValuesTestingTransform | ||
+ | ^PackageChange hierarchyChanges: | ||
+ | classReference: | ||
+ | classChanges: | ||
+ | </ | ||
+ | |||
+ | FileOut from VW with: | ||
+ | |||
+ | <code Smalltalk> | ||
+ | |||
+ | then fileIn into a Squeak image with Values loaded. | ||
+ | |||
+ | Loads without errors. | ||
+ | |||
+ | The Transcript shows: | ||
+ | <code Smalltalk> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | </ | ||
+ | |||
+ | The VW error classes are not known in Squeak. We define a rewrite of the three test methods: | ||
+ | |||
+ | <code Smalltalk> | ||
+ | ValuesTestingTransform | ||
+ | ^PackageChange | ||
+ | hierarchyChanges: | ||
+ | classReference: | ||
+ | classChanges: | ||
+ | localChanges: | ||
+ | classReference: | ||
+ | instanceChanges: | ||
+ | add: (Rewrite method: # | ||
+ | add: (Rewrite method: # | ||
+ | add: (Rewrite method: # | ||
+ | yourself))) | ||
+ | </ | ||
+ | |||
+ | The rule ''# | ||
+ | |||
+ | <code Smalltalk> | ||
+ | replaceSqueakErrorClasses | ||
+ | ^(self new) | ||
+ | replace: SubscriptOutOfBoundsError name asString with: #Error asString; | ||
+ | replace: NonIntegerIndexError name asString with: #Error asString; | ||
+ | replace: NotFoundError name asString with: #NotFound asString; | ||
+ | yourself | ||
+ | </ | ||
+ | |||
+ | Published as **[Squeak Fileout PDFtalk] (3.0.0.7, | ||
+ | ===== FileIn 7 - Tests ===== | ||
+ | |||
+ | FileOut [Values] and [Values Testing], then fileIn into a fresh Squeak image. | ||
+ | |||
+ | Loads without errors. | ||
+ | |||
+ | The Transcript shows: | ||
+ | <code Smalltalk> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | ValuemapTests>> | ||
+ | </ | ||
+ | |||
+ | |||
+ | Published as **[Squeak Fileout PDFtalk] (3.0.0.8, |