On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker <gmbec...@ucdavis.edu> wrote: > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) character() > rather than the NA_character_?
No. It should still be safe to assume that mkString() always returns a character vector of exactly length one. Anything else could lead to type errors. > An empty string and NULL aren't the same. Exactly! So if you pass in an empty C string, you get an empty R string, and if you pass in a null pointer you get NA. Rf_mkString(NULL) <--> NA Rf_mkString("") <--> "" There is no ambiguity, and much better than segfaulting. ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel