Greetings All,
Trie is a subclass of Collection and currently inherits its #storeOn: method, which does not
produce a correct store string for a Trie.
Attached is a better one, similar to the one in Dictionary, but please verify it. It reads as
follows:
storeOn: aStream
"Refer to the comment in Object|storeOn:."
| noneYet |
aStream nextPutAll: '(('.
aStream nextPutAll: self class name.
aStream nextPutAll: ' new)'.
noneYet := true.
self keysAndValuesDo:
[:each :val |
noneYet
ifTrue: [noneYet := false]
ifFalse: [aStream nextPut: $;].
aStream
nextPutAll: ' at: ';
store: each;
nextPutAll: ' put: ';
store: val].
noneYet ifFalse: [aStream nextPutAll: '; yourself'].
aStream nextPut: $)
_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org