Skip to content

Ellipsis expansion into arguments #49

@dgkf

Description

@dgkf

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

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions