Skip to content

deparse(substitute(arg)) in C?

3 messages · Duncan Murdoch, Brian Ripley

#
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()?

Duncan Murdoch
#
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:

            

  
    
#
On Sun, 18 Apr 2004 09:01:40 +0100 (BST), Prof Brian Ripley
<ripley@stats.ox.ac.uk> wrote:

            
Sounds like it.  Thanks!

Duncan Murdoch