Re: [R-pkg-devel] Using DOTS from C API

2025-08-18 Thread Iris Simmons
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

Re: [R-pkg-devel] Using DOTS from C API

2025-08-18 Thread Iris Simmons
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

Re: [R-pkg-devel] Using DOTS from C API

2025-08-18 Thread Ivan Krylov via R-package-devel
В 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

Re: [R-pkg-devel] Using DOTS from C API

2025-08-18 Thread Dirk Eddelbuettel
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

Re: [R-pkg-devel] Using DOTS from C API

2025-08-18 Thread Duncan Murdoch
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, ...).