Oh, forgot to mention. Using Rf_eval on a promise a second time does not
re-evaluate the promise. It simply returns the already calculated promise
value. So if that comes up, no need to worry about it.
On Mon, Aug 18, 2025, 14:26 Josiah Parry wrote:
> *Question:* what is the best way to access a
Generally, the best way to get access to the current environment is passing
environment() as an argument to your C function. I know that people will
tell you to use R_GetCurrentEnv() in C, but that does not work when the C
call is an argument to another function. For example:
tryCatch({
.Extern
В Mon, 18 Aug 2025 11:25:57 -0700
Josiah Parry пишет:
> *Question:* what is the best way to access a DOTSXP from R's C API in
> a function call.
In the future, there may be a C interface for that:
https://gist.github.com/lionel-/1ebcbd5ec69c0775d514c329522408a3?permalink_comment_id=5716011#gistc
It is sometimes helpful to see what other packages do / have done. Here we
get 46 hits in CRAN packages mirrored at GitHub [1], see
https://github.com/search?q=org%3Acran%20R_DotsSymbol&type=code
Dirk
[1] A superset. AFAIK archived packages do not disappear from the GH org.
--
dirk.eddelbue
On 2025-08-18 2:25 p.m., Josiah Parry wrote:
*Question:* what is the best way to access a DOTSXP from R's C API in a
function call.
Over at extendr (1) we'd like to be able to utilize `...` from the body of
a Rust function—with initial motivation being to support S3 generics like
print(x, ...).