From ripley at stats.ox.ac.uk  Fri Jun 17 08:42:12 2005
From: ripley at stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Fri, 17 Jun 2005 08:42:12 +0200 (CEST)
Subject: [Rd] (PR#7951) DispatchOrEval missing in do_isfinite and
Message-ID: <20050617064212.7D65BF8FA@slim.kubism.ku.dk>

These functions are not generic according to the help page.
The same page says explicitly that is.nan is generic.

Where did you get the (false) idea that they were generic?

On Thu, 16 Jun 2005 lars at predict.com wrote:

> Full_Name: Lars Hansen
> Version: 2.1.0
> OS: SunOS 5.8
> Submission from: (NULL) (207.66.36.189)
>
>
> Hi,
>
> S4 method displacth does not work for the two generic functions 
> 'is.finite' and 'is.infinite'. It turns out that the C functions 
> 'do_isfinite' and 'do_isinfinite' in src/main/coerce.c are missing a 
> call to 'DispatchOrEval' (see do_isnan). Added in the call fixed the 
> problem. My functions no look like this:
>
> Form coerce.c:
>
> SEXP do_isfinite(SEXP call, SEXP op, SEXP args, SEXP rho)
> {
>    SEXP ans, x, names, dims;
>    int i, n;
>
>    if (DispatchOrEval(call, op, "is.finite", args, rho, &ans, 1, 1))
>        return(ans);
>
>    checkArity(op, args);
>    ...
>
> SEXP do_isinfinite(SEXP call, SEXP op, SEXP args, SEXP rho)
> {
>    SEXP ans, x, names, dims;
>    double xr, xi;
>    int i, n;
>
>    if (DispatchOrEval(call, op, "is.infinite", args, rho, &ans, 1, 1))
>        return(ans);
>
>    checkArity(op, args);
>    ...

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] (PR#7951) DispatchOrEval missing in do_isfinite and
ripley@stats.ox.ac.uk