Garth Holland wrote:
The pipe operator appears in many languages (F#, Haskell, Elixir, Clojure
(threading macro)). It's an elegant way of chaining method/function calls in
the presence of additional parameters. The reddit example could be written
using a pipe operator |> #('apple' 'peach' 'banana') |> groupedBy: #size
        |> select: [:each | each size even]
        |> values
        |> collect: #asCommaString.

/Garth


Ah... so you mean instead of doing this?

(((#('apple' 'peach' 'banana') groupedBy: #size )
        select: [:each | each size even] )
        values )
        collect: #asCommaString.

Yes. The former does look nice.
cheers -ben

Reply via email to