On 5/19/23 14:37, Martin Maechler wrote:
Could you file a bug at R's bugzilla?
{I know we have too many open bugs there, notably related to S4,
but still you'd do a service to the R community.}
Done: https://bugs.r-project.org/show_bug.cgi?id=18538
Cheers,
H.
--
Hervé Pagès
Bioconductor
oops, wrong list sorry. I meant to send this to the R-devel list. Done now.
@Martin FWIW I worked around this by keeping the ellipsis in the arg
list of the method:
> setMethod("foo", "raw", function(x, y=-5, ..., z=22) y)
> selectMethod("foo", "raw")
Method Definition:
function (x, ..., z =
> Hervé Pagès
> on Fri, 19 May 2023 11:43:50 -0700 writes:
> Hi,
> Just ran across this:
> foo <- function(x, ..., z=22) z
> setMethod("foo", "character", function(x, y=-5, z=22) y)
> # Creating a generic function from function ‘foo’ in the global
Hi,
Just ran across this:
foo <- function(x, ..., z=22) z
setMethod("foo", "character", function(x, y=-5, z=22) y)
# Creating a generic function from function ‘foo’ in the global
environment
Then:
foo("a")
# [1] 22
Should return -5, not 22.
That's because the call to .