Skip to content

Ellipsis collection into a variable #48

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

Open
dgkf opened this issue Sep 6, 2023 · 0 comments
Open

Ellipsis collection into a variable #48

dgkf opened this issue Sep 6, 2023 · 0 comments
Labels
meta-proposal Language proposals theme-internals Relates to internal operations of the language type-enhancement New feature or request

Comments

@dgkf
Copy link
Owner

dgkf commented Sep 6, 2023

In R, ellipsis are often collected into a list of values using function(...) { list(...) }, but if we are to add #47, then we don't really have a good way of collecting "the rest". Instead, we should have some way of collecting ellipsis contents into a variable.

f <- function(a, b, ..rest) {
}

This would assign a new variable rest which contains the contents of list(...).

Together with #47, this would mean that we could also do something like:

list(head, ..tail) <- list(1, 2, 3, 4, 5, 6, 7)
@dgkf dgkf added type-enhancement New feature or request theme-internals Relates to internal operations of the language meta-proposal Language proposals labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-proposal Language proposals theme-internals Relates to internal operations of the language type-enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant