[Phylobase-devl] setGeneric vs. setMethod

Thibaut Jombart jombart at biomserv.univ-lyon1.fr
Wed Jun 25 15:11:03 CEST 2008


Hi Peter,
>
> Thanks Thibaut for that explanation.  It is all much clearer now, I
> still don't understand what the group argument to setGeneric() does,
> but perhaps I have to find a copy of the green book.
>
> If there aren't objections at some point I'd like to combine the pile
> of methods and generics we have into single setGeneric() calls.  As I
> mentioned we have a setMethod and setGeneric for hasNodeLabels.  I'll
> do a bit more testing, but is there any reason not to tidy up the code
> in this way?
>
> Peter
>   
Well, I do not think it is a problem to have a method defined for 
phylo4, even if it is not absolutely required since methods for both 
phylo4 and phylo4d would do the same thing, and this can be defined as 
the default behaviour of the generic. Personnally, I find it more 
readable as it is now, that is, to have a separate generic being just a 
call to the dispatcher, and then methods where we define what is done. 
To me this is an advantage of S4 system: you don't have to have a 
function doing all the jobs.

Cheers,

Thibaut.

-- 
######################################
Thibaut JOMBART
CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive
Universite Lyon 1
43 bd du 11 novembre 1918
69622 Villeurbanne Cedex
Tél. : 04.72.43.29.35
Fax : 04.72.43.13.88
jombart at biomserv.univ-lyon1.fr
http://biomserv.univ-lyon1.fr/%7Ejombart/
http://adegenet.r-forge.r-project.org/


More information about the Phylobase-devl mailing list