Skip to content
Prev 62924 / 63424 Next

Why does NextMethod() pick up duplicate arguments in '...' if given positionally at top level?

I don't think there's any valid reason for this behaviour, i.e. it's a 
bug.  For those who haven't read closely, the bug is that in the 
`foo(c)` call, within foo.default() the value of `c` is bound to both
x and to the first element of ... .

The 2012 thread you link to started with a slightly different setup and 
arguments were made by Simon that the behaviour is documented, but the 
final message in the thread is about the same bug as here.

I think the bug report 15654 is about the first setup, not the current one.

So what I'd suggest you do is report this example in a new bug report, 
and if you have the energy (seems nobody else does!), track down where 
the duplication happens, and include a patch to fix it.

If you do attempt that, you'll probably learn enough about NextMethod to 
decide whether to follow the suggestion in 15654, and could maybe submit 
a patch for that, too.

Duncan Murdoch
On 2025-03-25 2:12 a.m., Michael Chirico wrote: