From jmc at r-project.org  Tue Feb 15 21:52:00 2011
From: jmc at r-project.org (John Chambers)
Date: Tue, 15 Feb 2011 12:52:00 -0800
Subject: [Rd] Reference classes and ".requireCachedGenerics"
In-Reply-To: <AANLkTin+UGGVnk7XRWa5i2Y+3w_hC7rfTRpTh1SG+18j@mail.gmail.com>
References: <AANLkTin+UGGVnk7XRWa5i2Y+3w_hC7rfTRpTh1SG+18j@mail.gmail.com>
Message-ID: <4D5AE770.3090201@r-project.org>

No worries, and we will get rid of the warning message.

Certain of the S4 classes require methods for particular primitive 
functions.  If a subclass of one of those classes is loaded from a 
package, then we need to turn on method dispatch for the corresponding 
primitive(s).  For efficiency, this information is precomputed and 
stored in the variable you mentioned.  It's quite reasonable for several 
instances to be encountered.  Nothing specific to reference classes 
except that they need, e.g., methods for `$`.

The variable name can be added to a "dont.mind" list to suppress the 
warning.

Thanks for the catch.

John


On 2/15/11 9:45 AM, Jon Clayden wrote:
> Dear all,
>
> If I load a package which creates reference classes whilst another
> such package is also loaded, I get a warning about masking of the
> ".requireCachedGenerics" variable. (FWIW, both packages are
> lazy-loaded.) Googling this variable name turned up only one previous
> discussion, which didn't immediately help, except to suggest that it
> may be related to my defining an S3 method for one or more of the
> classes. It also pointed me at bits of the R source, but it wasn't
> obvious to me from that, what this variable is for.
>
> Aside from being a nuisance, I wonder if this is indicative of a
> problem on R's side or on mine, so I'd be glad for any clarification.
>
> This is R 2.12.1 on Mac OS X.6.6, though it still happens with the new
> 2.12.2 beta. Any feedback welcome.
>
> Thanks,
> Jon
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Reference classes and ".requireCachedGenerics"
John Chambers