-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit _ expansion rules to only expand into "things which look like function calls" #12
Comments
One question is what to do with macros, it seems that this should work, since it doesn't look like a function call: @_ data |> @view map(_.re, __)[1:3] but as you mentioned in #8, sometimes you will need brackets: a |> @m b |> c # parsed as a |> @m(b |> c) Would it be crazy for |
I think it's a bit dangerous to second guess the language parsing rules, I think it will lead to irregularities and surprises in the longer term. For example, the user could write this as |
An interesting case from #18 (comment) which I agree should work. julia> any(>(3), 1:4) ? "yes" : "no"
"yes"
julia> @_ any(_>3, 1:4) ? "yes" : "no"
ERROR: TypeError: non-boolean (var"#13#14") used in boolean context |
Note that such examples won't work very well in pipelines -- I'm unsurprised by
|
We've had a couple of specific cases where
_
expansion is confusing - opened in #6 and #8 and solved by #10.But because #10 is breaking, I'd like to make sure we have a single consistent-as-possible syntax rule before the next release. Something like:
See #6 and #8 for extensive discussion.
The text was updated successfully, but these errors were encountered: