R-alpha: UseMethod()

Ross Ihaka (ihaka@stat.auckland.ac.nz)
Mon, 9 Sep 1996 10:21:50 +1200


Date: Mon, 9 Sep 1996 10:21:50 +1200
From: Ross Ihaka <ihaka@stat.auckland.ac.nz>
Message-Id: <199609082221.KAA09275@stat.auckland.ac.nz>
To: r-testers <r-testers@stat.math.ethz.ch>
Subject: R-alpha: UseMethod() 
In-Reply-To: <Pine.SUN.3.91.960906180942.15611C-100000@babcomm>

Gregory R. Warnes writes:
 > 
 > I notice that R's UseMethod requires two arguments, as in the call for print:
 > > print
 > function (x, ...) 
 > UseMethod("print", x, ...)
 > 
 > However, SPlus's UseMethod uses only one argument:
 > > print
 > function(x, ...)
 > UseMethod("print")
 > 
 > I have a number of functions that call UseMethod, and would rather not 
 > have two copies, one for SPlus and one for R.  It seems that it should be 
 > possible to modify do_usemethod to grab the appropriate parameters from 
 > the parent's call using syscall(sysparent(1,env)).  

A quick solution to this problem is to write your code the R way
because this will also work in S.  We'll have a look at your proposed
fix anyway.  Compatibility is always nice.
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-