From maechler at stat.math.ethz.ch  Mon Mar  2 11:16:21 2009
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Mon, 2 Mar 2009 11:16:21 +0100
Subject: [Rd] Unexpected side effect of the ":::" operator on the value
	of isGeneric
In-Reply-To: <49A97BEF.60907@ebi.ac.uk>
References: <49A58AA7.8030500@ebi.ac.uk>
	<18857.8527.746773.902464@cmath-5.math.ethz.ch>
	<49A97BEF.60907@ebi.ac.uk>
Message-ID: <18859.45557.476230.481491@stat.math.ethz.ch>

>>>>> "Wolfi" == Wolfgang Huber <huber at ebi.ac.uk>
>>>>>     on Sat, 28 Feb 2009 18:01:19 +0000 writes:

    Wolfi> Dear Martin name masking is a separate issue, which I
    Wolfi> do not want to explore here.

    Wolfi> If one accepts the notion that unrelated generics of
    Wolfi> the same name may exist in different namespaces (user
    Wolfi> confusion aside, I don't see a technical reason why
    Wolfi> one shouldn't), then I find the behaviour of R in the
    Wolfi> below case puzzling: the value of
    Wolfi> "showMethods(something)" called from the global
    Wolfi> environment depends on whether or not the expression
    Wolfi> "package::something" has previously been
    Wolfi> evaluated. The value of isGeneric(something) is
    Wolfi> different when called from top-level and when called
    Wolfi> within showMethods.

    Wolfi> Best wishes Wolfgang


    Wolfi> PS1: I do apologize if this behaviour is intentional,
    Wolfi> and documented somewhere. I would then be puzzled
    Wolfi> even more though.

    Wolfi> PS2: My code example used ":::", and there are some
    Wolfi> vague warnings in its man page that ":::" is
    Wolfi> "dangerous". The problem also occurs with "::".

Thank you, Wolfgang (and Martin Morgan), for the clarification,
here and off-line. 
Just for a public summary:  
You have convinced me that this is indeed pointing to a bug in the current
R implementation, and IIUC, at least one expert (JMC) is looking at a fix.

Regards,
Martin



[Rd] Unexpected side effect of the ":::" operator on the value of isGeneric
Martin Maechler