From ripley at stats.ox.ac.uk  Sun Apr 18 10:01:40 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sun Apr 18 10:01:44 2004
Subject: [Rd] deparse(substitute(arg)) in C?
In-Reply-To: <qvd380p2852fiaeo8quuft7sqfk39guhdu@4ax.com>
Message-ID: <Pine.LNX.4.44.0404180846340.13354-100000@gannet.stats>

Isn't it much easier to just pass deparse(substitute(arg)) as an extra 
argument to the .Internal call?

deparse is no problem, as it has C-level equivalents.  substitute is more 
of a problem as you need to give the correct evaluation environment.
Since you can call .Internal directly or inside a wrapper function, the 
latter is not entirely clear to me (but presumably it is the argument of 
the wrapper and not of .Internal that you want).  Then you need to worry 
about not evaluating arguments to the .Internal call, which can only be 
done for all args ....

On Sat, 17 Apr 2004, Duncan Murdoch wrote:

> In R code, "deparse(substitute(arg))" is the usual way to construct a
> label for an argument.  Is there an equivalent to this in C code
> working on an SEXP, inside a function called by .Internal()?

-- 
Brian D. Ripley,                  ripley@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] deparse(substitute(arg)) in C?
Prof Brian Ripley