pipe

Fabio Filasieno fabio.filasieno at gmail.com
Sat Aug 25 22:18:15 UTC 2007


On Aug 25, 2007, at 7:35 PM, leves at elte.hu wrote:

> pipe: aBlock
>
>     | catcher pipedObject |
>     catcher := MessageCatcher new
>         privAccumulator: OrderedCollection new.
>     aBlock value: catcher.
>     pipedObject := self.
>     catcher privAccumulator do: [ :each |
>         pipedObject := each sendTo: pipedObject ].
>     ^pipedObject


Thanks leves ... :-) ...! You rock !
I didn't know about the MessageCatcher.

Really really close .... as this fails.

| collection |
collection := OrderedCollection new.
collection add:10; add:20; add:30.
10 pipe: [:item | item + 1 ; + 1; > 10 ; ifTrue: [#True] ifFalse: 
[#False]  <- No special messages expected ->]


Fabio


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070826/6d0aeedc/attachment.htm


More information about the Squeak-dev mailing list