[ANSI-Smalltalk] #contents on <collectionStream>
Bruce Badger
bwbadger at gmail.com
Mon Oct 20 18:27:18 BST 2008
On 20/10/2008, Paolo Bonzini <bonzini at gnu.org> wrote:
>
> >> For reading past and future values in WriteStream you could do "x
> >> setToEnd; contents" but I never found a usage for it.
> >
> > There's one above.
>
>
> Interesting. We need other opinions.
I would expect >>contents to be independent of position. Where
>>contents could not be reasonably and consistently implemented I
would suggest that an exception be thrown.
So, I think this should be true: ((ReadStream on: 'abc') next; contents) = 'abc'
But >>contents sent to a ReadStream on a socket, and perhaps even a
file, should raise an exception.
If we need to have a number of read and write stream classes to make
behaviour obvious then I think that's better than to cram many subtle
meanings and variations into one protocol.
It would also be good to know what aStream reset; position was. 0 or
1. I prefer 0 because, not least, it makes more sense when the
contents are empty.
We'll need a Step to express what the ANSI standard says now, and then
we can base other Steps on that to propose changes (if any are
needed).
All the best,
Bruce
--
Make the most of your skills - with OpenSkills
http://www.openskills.org/
More information about the ANSI-Smalltalk
mailing list