From ross at biostat.ucsf.edu  Wed Oct 28 20:30:58 2009
From: ross at biostat.ucsf.edu (Ross Boylan)
Date: Wed, 28 Oct 2009 12:30:58 -0700
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: <1256758258.10798.43.camel@corn.betterworld.us>

R 2.8.1 on Windows behaves as I expected, i.e., the final args(foo)
returns a function of x.  The previous example (below) was on Debian
GNU/Linux.


On Wed, 2009-10-28 at 12:14 -0700, 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")
> 
> Ross 
>



[Rd] mysteriously persistent generic definition
Ross Boylan