From murdoch at stats.uwo.ca  Wed Oct 28 20:31:44 2009
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Wed, 28 Oct 2009 15:31:44 -0400
Subject: [Rd] mysteriously persistent generic definition
In-Reply-To: <1256757244.10798.39.camel@corn.betterworld.us>
References: <1256267219.30505.148.camel@corn.betterworld.us>
	<1256757244.10798.39.camel@corn.betterworld.us>
Message-ID: <4AE89C20.1010209@stats.uwo.ca>

On 10/28/2009 3:14 PM, Ross Boylan wrote:
> Here's a self-contained example of the problem:
> 
>> foo <- function(obj) {return(3);}
>> setGeneric("foo")
> [1] "foo"
>> removeGeneric("foo")
> [1] TRUE
>> foo <- function(x) {return(4);}
>> args(foo)
> function (x) 
> NULL
>> setGeneric("foo")
> [1] "foo"
>> args(foo)
> function (obj) 
> NULL
> 
> R 2.7.1.  I get the same behavior whether or not I use ESS.
> 
> The reason this is more than a theoretical problem:
> 
>> setMethod("foo", signature(x="numeric"), function(x) {return(x+4);})
> Error in match.call(fun, fcall) : unused argument(s) (x = "numeric")

We just released 2.10.0.  It doesn't have this problem, nor does 2.9.2, 
or 2.8.1.  I think you'll just have to upgrade.

Duncan Murdoch



[Rd] mysteriously persistent generic definition
Duncan Murdoch