Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-22 Thread Romain Fenouil
Dear Martin Morgan, thank you very much for your answer that made it clear to me. Since my package is linked to yours by essence, there is no reason to redefine the existing setGeneric functions. As a summary, if someone is importing functions from another package, he is supposed to know they alr

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-21 Thread Greg Minshall
the world's most minor typo on https://github.com/hadley/devtools/wiki/Rcpp optimisiation helpful page, btw! thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pr

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-21 Thread Greg Minshall
(apologies for not having edited the to/cc list) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-conta

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-20 Thread Martin Morgan
On 02/20/2013 02:19 AM, Romain Fenouil wrote: Dear members, please excuse me for eventual mistake in posting my first message on this list. I am actually glad to read these very interesting questions and answers because I have been facing a related situation for the last 2 days. I am writing a R

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-20 Thread Romain Fenouil
Dear members, please excuse me for eventual mistake in posting my first message on this list. I am actually glad to read these very interesting questions and answers because I have been facing a related situation for the last 2 days. I am writing a R package that is using some of the interesting f

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-15 Thread Greg Minshall
William, > and here mention "intra-class name clashes" (I'm not sure what you > mean by this). sorry, i meant, in something like C++, if i have a class Foo and you have a class Bar, then i can invent whatever method names/signatures i want, independent of whatever method names/signatures *you* wa

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-15 Thread Hadley Wickham
This is unfortunately reinforced by the "(Not So) Short Introduction to S4 Object Oriented Programming in R" - I wouldn't recommend that document to learn about S4. The most important thing to get about OO in R is that methods belong to generic functions, not like classes, as in most other program

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-15 Thread William Dunlap
I thought you were thinking of the R class system (the S3 and S4 ones anyway) as if it were C++'s. It is quite different. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: Greg Minshall [mailto:minsh...@umich.edu] > Sent: Friday, February 15, 2013 1:37

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-15 Thread William Dunlap
..@r-project.org] On > Behalf > Of Greg Minshall > Sent: Friday, February 15, 2013 3:35 AM > To: Martin Morgan > Cc: r-help@r-project.org > Subject: Re: [R] 2 setGeneric's, same name, different method signatures > > Martin, > > fantastic. thank you *very* much!

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-15 Thread Greg Minshall
Martin, fantastic. thank you *very* much! that clears lots of things up for me. (for the record: i think that setGeneric overwriting a previous is more surprising -- thus violating the principle of least surprise -- than one function overwriting a previous, in that we think of (or, one way to t

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-14 Thread Greg Minshall
i'm answering my own question: 1. setGeneric's override (wipe out, really) previous ones. (this is pointed out in section 5.3 of "A (Not So) Short Introduction to S4 Object Oriented Programming in R" by Christophe Genolini.) 2. the *names* of the formals are important. 3. one can specify a

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-14 Thread Martin Morgan
On 2/14/2013 8:57 AM, Greg Minshall wrote: hi. below is a small test case (hopefully minimal, though i'm still a bit confused about initializers). i would have guessed (and maybe i still would have been right) that one could re-use the name of a generic function for functions with different num