Skip to content
Prev 49442 / 63424 Next

Feature request: mixing `...` (three dots) with other formal arguments in S4 methods

Hi Gabriel,

and thanks for answering. I'm basically just trying to find a way to use
the power of `...` in more complex scenarios and I'm well aware that this
might not be the best approach ;-)

Regarding your actual question:
"Are you suggesting methods be dispatched based on the *contents* of ...
[...]?"
Yes, I guess currently I kind of do - but not on the argument *names*

I'm not expecting functions to detect the argument *names*  from `...`, but
the relevant "argument containers" from which then the actual arguments
should be extracted and used:

I thought the *actual* arguments to be passed via `...` to subsequent
functions/methods could be put into an "arguments container" (as a list so
you could easily use them with `do.call(foo)`) that has a class that `foo`
expects for its `...` argument (e.g. `ThreedotsForFoo`). What I would like
to accomplish is that `foo` auto-detects those parts coming in via `...`
that are *relevant* for itself (e.g. instances of the argument container
`ThreedotsForFoo`), that it handles them in a proper way (i.e. extracting
the *actual* arguments from the container) and that it passes `...` along
to subsequently called functions.

That's why I would need methods that use mix of regular formal arguments
and `...`.

Best regards,
Janko


On Thu, Nov 27, 2014 at 7:48 PM, Gabriel Becker <gmbecker at ucdavis.edu>
wrote: