Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
valuesportinglog [2022/01/31 12:43] christian [Undeclared class references] |
valuesportinglog [2022/02/27 13:33] christian [FileIn 5] |
||
---|---|---|---|
Line 12: | Line 12: | ||
^PackageChange new</ | ^PackageChange new</ | ||
+ | If you don't have VisualWorks and cannot create the fileOut yourself, all versions are on GitHub. | ||
+ | |||
+ | The fileOut of this configuration is [[https:// | ||
===== First FileIn ===== | ===== First FileIn ===== | ||
File out from VW with | File out from VW with | ||
<code Smalltalk> | <code Smalltalk> | ||
- | Start squeak, open the Transcript and file in "Values.Squeak.st" | + | Start squeak, open the Transcript and file in [[https:// |
<code Smalltalk> | <code Smalltalk> | ||
Line 56: | Line 59: | ||
===== FileIn 2 ===== | ===== FileIn 2 ===== | ||
- | FileOut from VW, then fileIn into a fresh Squeak image. | + | FileOut from VW, then fileIn |
Loads about 80% until it hits the error that ColorValue is not defined. | Loads about 80% until it hits the error that ColorValue is not defined. | ||
Line 112: | Line 115: | ||
Published as **{Smalltalk Transform Project} (1.4.0.5, | Published as **{Smalltalk Transform Project} (1.4.0.5, | ||
+ | |||
+ | Published as **[Squeak Fileout PDFtalk] (3.0.0.4, | ||
+ | |||
===== FileIn 3 ===== | ===== FileIn 3 ===== | ||
- | FileOut from VW, then fileIn into a fresh Squeak image. | + | FileOut from VW, then fileIn |
- | 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 [[https:// | ||
+ | |||
+ | 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 [[https:// | ||
+ | |||
+ | 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 or warnings! | ||
+ | |||
+ | < | ||
+ | 2. milestone: <span style=" | ||
+ | </ | ||
+ | |||
+ | Test results: | ||
+ | 25 run in 0:00:00:00, 0 passes, 0 expected failures, 1 failures, 24 errors, 0 unexpected passes | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The next step must be done in Squeak: fix the implementation to make the tests pass and modify the transformation so that the next fileOut contains the right code. If you don't have access to VW, please send a change file. |