Does julia support chaining of collections methods / function chaining at this point?

There is a moderately long JIRA about function chaining https://github.com/JuliaLang/julia/issues/5571 . It is unclear what if anything resulted from that JIRA - and thus in what form chaining is presently supported. Clarification and a pointer to examples would be appreciated.

I do not at all know the thinking of any of the core devs on this but as far as I can tell no action has been taken in base as a result of the discussion in https://github.com/JuliaLang/julia/issues/5571. For example, a quick test in julia 1.3 shows that the pipe operator still only seems to work with single argument methods. That matches the docs: https://docs.julialang.org/en/latest/manual/functions/#Function-composition-and-piping-1.

Seeing as 5571 is still open I personally don’t find it surprising that this has not been definitely decided one way or another. When there are PRs to base the core devs/the community at large seem to be good at referencing the key github issues.

Outside of base, there do seem to be some packages that address function chaining. Have you seen the following thread/post? Function chaining with |> and filter function - #3 by baggepinnen. It mentions two packages that offer more sophisticated piping behaviour.

1 Like