c42f/Underscores.jl

Redesign _ -> identity transforms

rapus95 opened this issue · 2 comments

Suggestion: Whenever some underscore tends to be replaced by an identity function, make the anonymous function escape a single layer.
That will automatically enable cases like that:
1:10 |> filter(_<5, _)
while we don't lose a relevant feature. Using _ instead of identity shouldn't be considered good style anyway.

Seems related to my suggestion in #1; I agree with the comments on #24990 that using the _ to mean two things in the same expression could be pretty confusing to a reader of the code.

c42f commented

Agreed, I think this is a dup of #1 (in terms of functionality), let's continue the discussion there :-)