Skip to content

Conversation

tfiers
Copy link
Contributor

@tfiers tfiers commented Jan 7, 2022

This clarifies the current behaviour where the subsequent pipes get parsed as part of the anonymous function's body if there are no parentheses.

The current line

[1:5;] |> x->x.^2 |> sum |> inv

is parsed as

[1:5;] |> x -> (x.^2 |> sum |> inv)

but it feels like the author meant (and readers would expect)

[1:5;] |> (x->x.^2) |> sum |> inv

This PR makes this explicit.

See also #38761 and #43661.

@aviatesk aviatesk merged commit 4f1ff0b into JuliaLang:master Jan 7, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants