Skip to content

(PR#7951) DispatchOrEval missing in do_isfinite and do_isinfinite

1 message · lars@predict.com

#
Hi,

OK, if you try to explicitly make them generic, you are told that they 
are implicitly already generic:

 > setGeneric("is.finite", function(from, ...) standardGeneric("is.finite"))
Error in setGeneric("is.finite", function(from, ...) 
standardGeneric("is.finite")) :
    "is.finite" is a primitive function;  methods can be defined, but 
the generic function is implicit, and can't be changed.

If you query about its genericness before you define you own generic, 
you get:

 > isGeneric("is.finite")
[1] FALSE

But after you define you own generic, you get:

 > setMethod("is.finite", signature(x="TS"),
+           function(x) {
+              Data(x) = callNextMethod()
+              x
+           })
[1] "is.finite"

 > isGeneric("is.finite")
[1] TRUE

This all makes some sense, but I am not familiar enough with he 
internals to explain exactly why it is done this way. I think you will 
fine that 'is.nan' behave exactly the same way.

Thanks,
Lars
Prof Brian Ripley wrote: