Actually, after reading the comment about it being OK for it being
NULL, it's not a bug after all.
On Thu, Jan 22, 2015 at 5:57 AM, Michael Lawrence wrote:
> I also just noticed that there is a bug: identical(ans, FALSE) should
> be is.null(ans).
>
> So no error is thrown:
>> methods:::genericFor
I also just noticed that there is a bug: identical(ans, FALSE) should
be is.null(ans).
So no error is thrown:
> methods:::genericForPrimitive("foo")
NULL
Will fix.
On Wed, Jan 21, 2015 at 3:13 PM, Peter Haverty wrote:
> Doing it like this:
>
> genericForPrimitive <- function(f, where = topenv(p
Doing it like this:
genericForPrimitive <- function(f, where = topenv(parent.frame()), mustFind
= TRUE) {
ans = .BasicFunsList[[f]]
## this element may not exist (yet, during loading), dom't test null
if(mustFind && identical(ans, FALSE))
stop(gettextf("methods may not be d
Note that setMethod() resolves .BasicFunsList in the methods namespace
directly when setting a method on a primitive. Somehow there should be
consistency between genericForPrimitive() and the check in setMethod().
Also, we can probably step away from the use of elNamed(), given that [[
now uses ex