[R] Building promise evaluations

Andrew Simmons @kw@|mmo @end|ng |rom gm@||@com
Thu May 12 18:17:09 CEST 2022


I was hoping to build some promise evaluations and put them into a
call to be evaluated, but it doesn't seem as though there's an easy
way to build the promises. I can see from the r-source repository that
the C function mkPROMISE defined in Defn.h is what I need, but that
file doesn't seem to be included when downloaded (R.home("include")
does not contain this file).

I'm not particular about whether this has to be done at the R level or
at the C level, any solution is good to me.

Just in case anyone is wondering "why don't you just evaluate the call
in the same environment as you would assign to the promises?", I want
to evaluate the function and the first argument in my own environment,
and the rest of the arguments in an environment of the user's
choosing, and I can't do that without promises. Another question "why
don't you use the argument ... in your function to pass arguments
which will be evaluated in the user's environment?", I can't do that
either. The user's arguments are provided as a string from which the R
code is extracted, parsed, and then I can make use of them. Any help
is greatly appreciated!

    Andrew Simmons

More information about the R-help mailing list