-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
meta-proposalLanguage proposalsLanguage proposalstheme-internalsRelates to internal operations of the languageRelates to internal operations of the languagetype-enhancementNew feature or requestNew feature or request
Description
The inverse of #48 is expanding into ellipsis.
I think this should use the same syntax as #48
args <- list(sep = "-", collapse = "; ")
paste("Hello", c("World", "Friends"), ..args)
I don't think there are situations where it's ambiguous. ..rest
for collecting into arguments will only happen when destructuring or in a function signature, while ..rest
for passing arguments only happens in calls. This might introduce some confusion in situations where the ..rest
argument in a function signature is re-used as an argument to default value for another parameter:
f <- function(a, b = sum(..rest), ..rest)) {
}
In this case, the ..rest
at the end of the function call collects args, while the ..rest
in names(..rest)
passes those arguments to sum
.
Metadata
Metadata
Assignees
Labels
meta-proposalLanguage proposalsLanguage proposalstheme-internalsRelates to internal operations of the languageRelates to internal operations of the languagetype-enhancementNew feature or requestNew feature or request