Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-16 Thread Janko Thyson
Thanks for the info/suggestions! But note that it's not just a one-step, but a two step dispatching process with respect to `...`. That is, `foo()` and `bar()` are *not* both called directly inside `foobar()`: `foobar()` only calls `foo()` which then calls `bar()`. I now came up with something

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-16 Thread Duncan Murdoch
On 16/11/2014, 11:42 AM, Janko Thyson wrote: Thanks for the info/suggestions! But note that it's not just a one-step, but a two step dispatching process with respect to `...`. That is, `foo()` and `bar()` are *not* both called directly inside `foobar()`: `foobar()` only calls `foo()` which

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-16 Thread Jeff Newmiller
You have some interesting ideas about what makes for improvements in parameter interfaces. Wrapping the arguments into a list is like creating an object to represent all of them, except that you don't have the benefits of a class to go with that cognitive shift. And if making classes to hold

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-16 Thread Janko Thyson
@Duncan, @Jeff: thanks for giving me your opinions, I really appreciate that! I'm not saying that this is something that should *generally* be used and I perfectly understand your concerns. However: correct me if I'm wrong, but actually I'm not doing much more than generalizing the idea behind

[R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-15 Thread Janko Thyson
Dear list, I wonder if there's a clever way to fine control the exact way arguments are dispatched via R's three dots argument Consider the following use case: - you have a function foobar() that calls foo() which in turn calls bar() - *both* foo() and bar() have an argument that's

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-15 Thread Jeff Newmiller
AFAIK You have to alter the name of at least one of the y arguments as used by foobar, and anyone calling foobar has to read about that in the help file. That is only one y can be in e.g. foobar - function( x, y_foo, ... ) { foo( x, y=y_foo, ... ) bar( x, ... ) }

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-15 Thread Duncan Murdoch
On 15/11/2014, 11:26 AM, Jeff Newmiller wrote: AFAIK You have to alter the name of at least one of the y arguments as used by foobar, and anyone calling foobar has to read about that in the help file. That is only one y can be in e.g. foobar - function( x, y_foo, ... ) { foo( x,