Skip to content

Commit

Permalink
doc: add parens to example |> docstring (#36155)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniedie committed Feb 26, 2022
1 parent fe1264a commit 5ac0020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,11 @@ widen(x::Type{T}) where {T} = throw(MethodError(widen, (T,)))
|>(x, f)
Applies a function to the preceding argument. This allows for easy function chaining.
When used with anonymous functions, parentheses are typically required around the definition to get the intended chain.
# Examples
```jldoctest
julia> [1:5;] |> (x->x.^2) |> sum |> inv
julia> [1:5;] .|> (x -> x^2) |> sum |> inv
0.01818181818181818
```
"""
Expand Down

2 comments on commit 5ac0020

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.