[Rd] External special functions (SPECIALSXP)
Peter Danenberg
pcd at roxygen.org
Wed May 25 20:05:47 CEST 2011
> However, if you don't want to evaluate the arguments, just pass
> substitute(arg) to your function instead of arg.
Thanks, Duncan; the problem is, I'm trying to substitute on `...' and
I don't think I can access `...' without inadvertently evaluating it.
I'm trying to write a debugging function which, given any number of
expressions, prints the expression next to its evaluation.
This is trivial to do in the single arity case:
debug <- function(expression) {
cat(substitute(expression), expression, "\n")
}
a <- 2
debug(a)
a 2
but I'm not sure how to make it work with variable arity without
resorting to SPECIALSXP.
More information about the R-devel
mailing list