[Rd] STRING_IS_SORTED claims as.character(1:100) is sorted

2018-11-15 Thread Michael Sannella via R-devel
If I have loaded the C code: SEXP altrep_STRING_IS_SORTED(SEXP x) { return ScalarInteger(STRING_IS_SORTED(x)); } and defined the function: issort <- function(x) .Call("altrep_STRING_IS_SORTED",x) I am seeing the following results in R 3.5.1/Linux: > issort(LETTERS)

[Rd] error unserializing ascii format (v2 or v3)

2018-11-07 Thread Michael Sannella via R-devel
I ran into an interesting error unserializing a file created with ascii=TRUE: R 3.5.1 (Windows or Linux): > unserialize(serialize(list(raw=as.raw(c(39,41))), NULL, version=2, ascii=TRUE)) Error in unserialize(serialize(list(raw = as.raw(c(39, 41))), NULL, version = 2, : ReadItem: un

[Rd] v3 serialization of compact_intseq altrep should write modified data

2018-10-22 Thread Michael Sannella via R-devel
Experimenting with altrep objects and v3 serialization, I discovered a possible bug. Calling DATAPTR on a compact_intseq object returns a pointer to the expanded integer sequence in memory. If you modify this data, the object values appear to be changed. However, if the compact_intseq object is

[Rd] R_ext/Altrep.h should be more C++-friendly

2018-10-08 Thread Michael Sannella via R-devel
I am not able to #include "R_ext/Altrep.h" from a C++ file. I think it needs two changes: 1. add the same __cplusplus check as most of the other header files: #ifdef __cplusplus extern "C" { #endif ... #ifdef __cplusplus } #endif 2. change the line R_new_alt

[Rd] bug with OutDec option and deferred_string altrep object

2018-10-08 Thread Michael Sannella via R-devel
While implementing R's new 'altrep' functionality in the TERR engine, I discovered a bug in R's 'deferred_string' altrep object: it is not using the correct value of the 'OutDec' option when it expands a deferred_string. See the following example: R 3.5.1: (same results in R 3.6.0 devel engine bu