Skip to content

getAnywhere and functions starting with "." (PR#7684)

2 messages · Mark Bravington, Brian Ripley

#
Full_Name: Mark Bravington
Version: 2.0.1
OS: Windows XP
Submission from: (NULL) (140.79.22.104)


'getAnywhere' crashes when its argument starts with a period:
Error in exists(x, envir, mode, inherits) : 
        invalid first argument

One fix might be to replace the line

if ( !is.null(f <- getS3method(gen, cl, TRUE))) {

with

if ( nchar( gen) && !is.null(f <- getS3method(gen, cl, TRUE))) {

Mark
#
This was mentioned a week or so ago on R-devel and is already fixed in the 
current sources: from the NEWS file

     o	getAnywhere() was confused by names with leading or trailing dots
 	(spotted by Robert McGehee)
On Fri, 11 Feb 2005 mark.bravington@csiro.au wrote:

            
It does not: it gives an error.  Please do read the comment on this in the 
posting guide!