Re: [Bioc-devel] issue with .local() hack used in S4 methods

2023-05-20 Thread Hervé Pagès
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

Re: [Bioc-devel] issue with .local() hack used in S4 methods

2023-05-20 Thread Hervé Pagès
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 =

Re: [Bioc-devel] issue with .local() hack used in S4 methods

2023-05-19 Thread Martin Maechler
> 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

[Bioc-devel] issue with .local() hack used in S4 methods

2023-05-19 Thread Hervé Pagès
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 .