Skip to content
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

Consider letting x... mean (x...,) #48738

Open
MasonProtter opened this issue Feb 20, 2023 · 0 comments
Open

Consider letting x... mean (x...,) #48738

MasonProtter opened this issue Feb 20, 2023 · 0 comments

Comments

@MasonProtter
Copy link
Contributor

MasonProtter commented Feb 20, 2023

Currently this errors:

julia> (2,3)...
ERROR: syntax: "..." expression outside call around REPL[75]:1

but this doesn't:

julia> 1, (2,3)...
(1, 2, 3)

Obviously, letting (2, 3)... == (2, 3) doesn't seem particularly useful on the surface, but I do find it useful in macros where I would like f(@g x, y) to mean f(@g(a), b) and @g x, y to mean (@g(x), y) which currently errors if @g(x, y) returns an Expr(:...). The reason I need to write the macro this way is because of #36547.

See for example #38713 (comment) and https://github.com/MasonProtter/SimpleUnderscores.jl#caveats

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 a pull request may close this issue.

1 participant