Re: as.name() is not idempotent (PR#337)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: as.name() is not idempotent (PR#337)
From: Kurt Hornik (Kurt.Hornik@ci.tuwien.ac.at)
Date: Wed 24 Nov 1999 - 17:19:16 EST


Message-ID: <14395.37236.157663.144059@aragorn.ci.tuwien.ac.at>

>>>>> maechler writes:

> as.name(as.name("ss"))

> gives an error in R (0.90 and earlier)
> but should of course give the same as simply

> as.name("ss")

> This reminds me of similar bug/problem... which I don't recall.

> Yes, I should build tests like these into "make test-Specific" ..

But not before fixing it, hopefully :-)

>From a brief glance at the code in coerce.c:

SEXP coerceVector(SEXP v, SEXPTYPE type)
{
    SEXP ans = R_NilValue; /* -Wall */
    if (TYPEOF(v) == type)
        return v;

    switch (TYPEOF(v)) {
#ifdef NOTYET
    case NILSXP:
        ans = coerceNull(v, type);
        break;
    case SYMSXP:
        ans = coerceSymbol(v, type);
        break;
#endif

So you simply need to write coerceSymbol() and move the #ifdef.

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:10 EST