[Rd] SET_COMPLEX_ELT and SET_RAW_ELT missing from Rinternals.h

Konrad Siek konr@d@@|ek @end|ng |rom gm@||@com
Fri Jun 25 16:28:26 CEST 2021


Hello,

I am working on a package that works with various types of R vectors,
implemented in C. My code has a lot of SET_*_ELT operations in it for
various types of vectors, including for CPLXSXPs and RAWSXPs.

I noticed SET_COMPLEX_ELT and SET_RAW_ELT are defined in Rinlinedfuns.h but
not declared in Rinternals.h, so they cannot be used in packages. I was
going to re-implement them or extern them in my package, however,
interestingly, ALTCOMPLEX_SET_ELT and ALTRAW_SET_ELT  are both declared in
Rinternals.h, making me think SET_COMPLEX_ELT and SET_RAW_ELT could be
purposefully obscured. Otherwise it may just be an oversight and I should
bring it to someone's attention anyway.

I have three questions that I hope R-devel could help me with.

1. Is this an oversight, or are SET_COMPLEX_ELT and SET_RAW_ELT not exposed
on purpose? 2. If they are not exposed on purpose, I was wondering why.
3. More importantly, what would be good ways to set elements of these
vectors while playing nice with ALTREP and avoiding whatever pitfalls
caused these functions to be obscured in the first place?

Best regards,
Konrad,

	[[alternative HTML version deleted]]



More information about the R-devel mailing list