From maechler at stat.math.ethz.ch  Tue Nov  7 18:57:58 2006
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 7 Nov 2006 18:57:58 +0100
Subject: [Rd] Getting the name of a SEXP type in package code?
In-Reply-To: <m24ptbe27p.fsf@ziti.local>
References: <m24ptbe27p.fsf@ziti.local>
Message-ID: <17744.51494.488768.338605@stat.math.ethz.ch>

>>>>> "Seth" == Seth Falcon <sfalcon at fhcrc.org>
>>>>>     on Tue, 07 Nov 2006 06:55:06 -0800 writes:

    Seth> Hi,
    Seth> Is there an alternative to type2char that is available for use in
    Seth> package code?  It would be useful for producing more informative error
    Seth> messages.

I haven't looked closely,  but I vaguely remember that I had
thought in the past,
(a version of)  type2char() should be made part of R's API.
Exactly because of the reason you give.

A more sensible name for the exported function would probably be
R_type2char    or 
Rtype_to_char  or
Rtype_as_char

If you are going to provide a patch (against R-devel),
you'd ideally also include the corresponding entry in
doc/manual/R-exts.texi ... (:-)

Martin

PS: I will be mostly absent from e-mail for the rest of the week.



[Rd] Getting the name of a SEXP type in package code?
Martin Maechler