[Cuis] #storeOn: for Trie

Juan Vuletich juan at jvuletich.org
Tue Jun 23 08:13:58 CDT 2015


Thanks, Dan. This is integrated in the latest push I did to GitHub last 
weekend.

Cheers,
Juan Vuletich

On 6/16/2015 6:25 PM, Dan Norton wrote:
> 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
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20150623/42f280e6/attachment-0004.html>


More information about the Cuis mailing list