Writing R-extensions
On Sat, 27 Aug 2005, Prof Brian Ripley wrote:
On Sat, 27 Aug 2005, Berwin A Turlach wrote:
...
3) The final sentence in the section on `Registering S3 methods' is:
Any methods for a generic defined in a package that does not
use a name space should be exported, and the package defining
and exporting the method should be attached to the search path
if the methods are to be found.
I wonder whether this should actually be:
Any methods for a generic defined in a package that does not
use a name space should be exported, and the package defining
and exporting the generic should be attached to the search path
^^^^^^^
if the methods are to be found.
Or is the implication of that sentence that if I have a package
with a name space which defines a method for a generic defined in
another package that does not use a name space, then this method
is only found if my package is attached to the search path and
mere loading of the namespace is not sufficient?
There is no typo here and your reading in the paragraph above is correct. Best, luke
I think we need to check with the author (Luke, r23430). If the generic
is not visible there is no dispatch and so this would be irrelevant.
Assuming a typo, your implication is what the svn log entry says and how I
read the text.
r23430 | luke | 2003-03-02 18:52:13 +0000 (Sun, 02 Mar 2003) | 3 lines
Added wording to clarify that S3method registration should only be used if
the generic is defined in a work space.
name?
...
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: luke at stat.uiowa.edu
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu