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

Mixing named and unnamed unpacking #3

Closed
DavisVaughan opened this issue Sep 23, 2024 · 2 comments
Closed

Mixing named and unnamed unpacking #3

DavisVaughan opened this issue Sep 23, 2024 · 2 comments

Comments

@DavisVaughan
Copy link

library(dotty)

.[apple = x, banana] <- list(w = 1, x = 2, y = 3, z = 4)
apple
banana

Both of these return 2, is that right?

In general getting this "right" is probably quite hard.

Maybe it should be "if any are named, all must be named"?

@kevinushey
Copy link
Owner

Maybe it should be "if any are named, all must be named"?

I think that is probably the simplest way forward to reduce confusion. If not, then I think the right approach would be to implement argument matching in a way similar to R.

@DavisVaughan
Copy link
Author

I vote for simplest and strictest now and if people revolt you can always relax it without breaking anything

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

No branches or pull requests

2 participants