[Newbies] using collect on a ReadStream

Norbert Hartl norbert at hartl.name
Tue Oct 30 07:20:21 UTC 2007

On Tue, 2007-10-30 at 08:03 +0100, Oscar Nierstrasz wrote:
> Hi Norbert,
> Streams don't support the collection protocols.  You can convert a  
> stream to a collection by sending #contents to the stream:
> stream := (ReadStream on: #( #(#a #b) #(#b #c))).
> stream contents collect: [:each| 'k',each first] --> #('ka' 'kb')
> Is that what you want?
Sure, it works :) What I do not understand is that a lot of the
collection protocol is in ReadStream. It has detect: select:
collect: includes: ... What is it for?



More information about the Beginners mailing list