Skip to content
Prev 8739 / 12125 Next

[R-pkg-devel] NOTE about use of `:::`

Here's another suggestion, not sure if it's any good, but you could
structure your functions like

parse_args <- function (envir = parent.frame())
{
    evalq(list(a = a, b = b, ..., y = y, z = z), envir)
    <...>
}

exported_fun <- function (a, b, ..., y, z)
{
    parse_args()
    <...>
}

It's seriously ugly, but it could work. You could also do some bquote
substitution

parse_args_expr <- quote(parse_args(a = a, b = b, ..., y = y, z = z))

exported_fun <- function (a, b, ..., y, z) NULL
body(exported_fun) <- bquote({
   .(parse_args_expr)
    <...>
})

On Wed, Dec 14, 2022, 20:36 David Kepplinger <david.kepplinger at gmail.com>
wrote: