Skip to content

Commit

Permalink
Merge pull request #28040 from JuliaLang/ksh/dotchain
Browse files Browse the repository at this point in the history
Add a little note about combining dot-ops and function chaining
  • Loading branch information
kshyatt authored Jul 12, 2018
2 parents 70bd2c2 + ca94b73 commit bec7827
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/src/manual/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,17 @@ they are equivalent to `broadcast` calls and are fused with other nested "dot" c
`X .+= Y` etcetera is equivalent to `X .= X .+ Y` and results in a fused in-place assignment;
see also [dot operators](@ref man-dot-operators).

You can also combine dot operations with function chaining using [`|>`](@ref), as in this example:
```jldoctest
julia> [1:5;] .|> [x->x^2, inv, x->2*x, -, isodd]
5-element Array{Real,1}:
1
0.5
6
-4
true
```

## Further Reading

We should mention here that this is far from a complete picture of defining functions. Julia has
Expand Down

0 comments on commit bec7827

Please sign in to comment.