[squeak-dev] Generators on Streams on Generators on Collections on ...

Eliot Miranda eliot.miranda at gmail.com
Mon Apr 11 18:01:06 UTC 2016



> On Apr 11, 2016, at 10:59 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> 
> 
>> On 11.04.2016, at 17:57, marcel.taeumel <Marcel.Taeumel at hpi.de> wrote:
>> 
>> Hi, there!
>> 
>> Please try the attached change set:  stream-chains.cs
>> <http://forum.world.st/file/n4889389/stream-chains.cs>  
>> 
>> It adds the possibility to attach transformations to streams using
>> generators.
>> 
>> Example:
>> 
>> foo := (#(1 2 3 4 5 6) readStream
>>  select: [:ea | ea even])
>>  collect: [:ea | 2 * ea].
>> foo upToNil. "#(4 8 12)"
> 
> upToNil -> upToEnd? :D

+1

> 
> Btw: I really like this api, can we do such things with Xtreams, too? 
> 
> Best
>    -Tobias
>> 
>> It is tested. :-)
>> 
>> Thanks Patrick for the idea.
>> 
>> Best,
>> Marcel
> 
> 
> 
> 


More information about the Squeak-dev mailing list