Re: [Rd] calling setGeneric() twice (don't; documentation comments)

2010-01-19 Thread Ross Boylan
On Tue, 2010-01-19 at 12:55 -0800, Seth Falcon wrote: > I would expect setGeneric to create a new generic function and > nuke/mask > methods associated with the generic that it replaces. I tried a test in R 2.7.1, and that is the behavior. I think it would be worthwhile to document it in ?setGene

Re: [Rd] calling setGeneric() twice

2010-01-19 Thread Seth Falcon
On 1/19/10 11:19 AM, Ross Boylan wrote: If files that were read in later in the sequence extended an existing generic, I omitted the setGeneric(). I had to resequence the order in which the files were read to avoid some "undefined slot classes" warnings. The resequencing created other problems,

Re: [Rd] calling setGeneric() twice

2010-01-19 Thread Ross Boylan
On Tue, 2010-01-19 at 10:05 -0800, Seth Falcon wrote: > > This came up because of some issues with the sequencing of code in > my > > package. Adding duplicate setGeneric's seems like the smallest, and > > therefore safest, change if the duplication is not a problem. > > I'm not sure of the answe

Re: [Rd] calling setGeneric() twice

2010-01-19 Thread Seth Falcon
On 1/19/10 10:01 AM, Ross Boylan wrote: Is it safe to call setGeneric twice, assuming some setMethod's for the target function occur in between? By "safe" I mean that all the setMethod's remain in effect, and the 2nd call is, effectively, a no-op. ?setGeneric says nothing explicit about this be

[Rd] calling setGeneric() twice

2010-01-19 Thread Ross Boylan
Is it safe to call setGeneric twice, assuming some setMethod's for the target function occur in between? By "safe" I mean that all the setMethod's remain in effect, and the 2nd call is, effectively, a no-op. ?setGeneric says nothing explicit about this behavior that I can see. It does say that if