On 25/05/2011 1:10 PM, Peter Danenberg wrote:
Is it possible to define an external special function (SPECIALSXP)?
I'm trying to do some language-level work, and don't want my arguments
evaluated before they hit C.

It looks like the only way to define a SPECIALSXP is by using XX0 in
the `eval' field of R_FunTab; is there any way to make this applicable
to externally defined functions?


I don't think so. However, if you don't want to evaluate the arguments, just pass substitute(arg) to your function instead of arg. For example,

 f <- function(a, b) {
   print(substitute(b))
   print(substitute(a))
 }

f( x <- 1, y <- 2 )

will print but never evaluate the assignments.

Duncan Murdoch

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to