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

Martin Maechler maechler at stat.math.ethz.ch
Mon Mar 2 11:16:21 CET 2009


>>>>> "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



More information about the R-devel mailing list