[FIX] File out pool dictionaries
David T. Lewis
lewis at mail.msen.com
Sat Jan 15 23:28:05 UTC 2000
A minor fix for filing out pool dictionaries in which the keys contain
the character $-
-------------- next part --------------
'From Squeak2.7 of 5 January 2000 [latest update: #1762] on 15 January 2000 at 6:16:47 pm'!
"Change Set: FileOutPoolsFix
Date: 15 January 2000
Author: David T. Lewis
Pool dictionaries can be filed out and filed in, but the keys in a
pool dictionary will be incorrectly tokenized during fileIn if they
are symbols containing the $- character. This can be prevented by
filing the keys out as #'someKeyName' rather than #someKeyName.
This change set adds the single quotes when filing out a class with
a pool dictionary."!
!Class methodsFor: 'fileIn/Out' stamp: 'dtl 1/15/2000 17:54'!
fileOutPool: aPool onFileStream: aFileStream
| aPoolName aValue |
aPoolName _ Smalltalk keyAtIdentityValue: aPool.
Transcript cr; show: aPoolName.
aFileStream nextPutAll: 'Transcript show: ''' , aPoolName , '''; cr!!'; cr.
aFileStream nextPutAll: 'Smalltalk at: #' , aPoolName , ' put: Dictionary new!!'; cr.
aPool keys asSortedCollection do: [ :aKey |
aValue _ aPool at: aKey.
aFileStream nextPutAll: aPoolName , ' at: #''' , aKey asString , '''', ' put: '.
(aValue isKindOf: Number)
ifTrue: [aValue printOn: aFileStream]
ifFalse: [aFileStream nextPutAll: '('.
aValue printOn: aFileStream.
aFileStream nextPutAll: ')'].
aFileStream nextPutAll: '!!'; cr].
aFileStream cr! !
More information about the Squeak-dev
mailing list
|