Closed t-kalinowski closed 1 month ago
Also, in that block, it might be simpler to just use R_ParseEvalString
instead of parsing and evaling separately. It would cut down on the amount of code needed.
it might be simpler to just use
R_ParseEvalString
instead of parsing and evaling separately. It would cut down on the amount of code needed.
Thanks, I didn't use it because
R_ParseEvalString
was not explained in WRE at that time, which means it's not an "API"R_ParseEvalString
is not very widely used among CRAN packages: https://github.com/search?q=org%3Acran+R_ParseEvalString&type=codeBut, now that reason 1 is no longer the case, it sounds good to me.
Hi, very nice crate + package + book!
I'm reading through the code and came across this: https://github.com/yutannihilation/savvy/blob/2e98d9c99e9972bb952d4feaf5c2cdd460d57deb/src/eval.rs#L52
I'm pretty sure this should be
let _guard = local_protect(charsxp);
Otherwise, the
LocalProtection
object is immediately dropped.Here is a minimal example demonstrating:
outputs:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=88fb5bb69f6a0666f51148be56d7ead0