persistently protect `x` and return it
| 37 | |
| 38 | // persistently protect `x` and return it |
| 39 | SEXP precious(SEXP x) { |
| 40 | PROTECT(x); |
| 41 | R_PreserveObject(x); |
| 42 | UNPROTECT(1); |
| 43 | return x; |
| 44 | } |
| 45 | |
| 46 | // returns the namespace environment for package `name` |
| 47 | SEXP precious_namespace(std::string name) { |