help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] performance of the json parser


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] performance of the json parser
Date: Mon, 05 Nov 2007 16:23:08 +0100
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)


WriteStream class extend [
    onSpecies: aSpecies [
        ^self on: (aSpecies new: 8)
    ]
]

?  Since collection species needs to support #new: anyway....

What about instead

ArrayedCollection class extend [
    writeStream [
        ^WriteStream on: (self new: 8)
    ]
]

As in "Array writeStream"? Actually, there is SequenceableCollection class>>#streamContents: too, which is what you were looking for. I am moving it to ArrayedCollection, since those are the collection for which the current implementation works.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]