Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Serguei Sokol
Le 17/04/2018 à 17:53, Dirk Eddelbuettel a écrit : On 17 April 2018 at 10:31, Dirk Eddelbuettel wrote: | | On 17 April 2018 at 15:09, Serguei Sokol wrote: ... | | It will automatically coerce NULL to a declared vector type. | | It's a more primitive solution than Nullable but in many cases | |

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Georgi Boshnakov
I may be missing something here but it doesn't seem right to introduce silent coercion of NULL to vectors, etc., especially if it would become imposed on everybody using Rcpp/Armadillo. Even the "convenience" of this is questionable. Georgi Boshnakov -Original Message- From: rcpp-de

Re: [Rcpp-devel] 4-dimensional array

2018-04-18 Thread Jeffrey Pollock
The Eigen tensor module (easily available via RcppEigen as far as I can tell) might be worth a look: http://eigen.tuxfamily.org/index.php?title=Tensor_support On Wed, Apr 18, 2018 at 3:13 AM, Dirk Eddelbuettel wrote: > > On 18 April 2018 at 01:56, Avraham Adler wrote: > | May not be possible. Se

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Dirk Eddelbuettel
On 18 April 2018 at 10:26, Georgi Boshnakov wrote: | I may be missing something here but | it doesn't seem right to introduce silent coercion of NULL to vectors, etc., | especially if it would become imposed on everybody using Rcpp/Armadillo. | Even the "convenience" of this is questionable.

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Serguei Sokol
Le 18/04/2018 à 12:26, Georgi Boshnakov a écrit : I may be missing something here but it doesn't seem right to introduce silent coercion of NULL to vectors, etc., especially if it would become imposed on everybody using Rcpp/Armadillo. Nothing is imposed. Everyone will be free to use Nullable me

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Serguei Sokol
Le 18/04/2018 à 13:32, Dirk Eddelbuettel a écrit : On 18 April 2018 at 10:26, Georgi Boshnakov wrote: | I may be missing something here but | it doesn't seem right to introduce silent coercion of NULL to vectors, etc., | especially if it would become imposed on everybody using Rcpp/Armadillo. |

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Dirk Eddelbuettel
Serguei, (Extra line breaks help readibility on text only mail readers) On 18 April 2018 at 14:51, Serguei Sokol wrote: | Le 18/04/2018 à 12:26, Georgi Boshnakov a écrit : | > I may be missing something here but | > it doesn't seem right to introduce silent coercion of NULL to vectors, etc., | >

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Jeff Newmiller
Regarding: "Actually, when NULL is provided to where a vector or a matrix is expected just an error is thrown. So we can hardly imagine that someone would have his program broken or will be misled if such coercion is introduced." If all programs were perfect this would be true, but the ability

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Serguei Sokol
Le 18/04/2018 à 15:59, Dirk Eddelbuettel a écrit : Could you use XPtr ? Probably yes, as I could use Nullable<> too. But at what price? For me, the code would become far less readable. Serguei. ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-p

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Serguei Sokol
Le 18/04/2018 à 16:15, Jeff Newmiller a écrit : Regarding: "Actually, when NULL is provided to where a vector or a matrix is expected just an error is thrown. So we can hardly imagine that someone would have his program broken or will be misled if such coercion is introduced." If all programs

Re: [Rcpp-devel] I'm having trouble installing packages that seem to be related to segfault with Rcpp

2018-04-18 Thread Shepherd, Lori
I updated my g++ and gcc versions and installed the appropriate libgfortran - when I tried to overwrite packages / reinstall - it still had ERRORs if I completed destroyed my local library and started from scratch the segfaults disappeared. seems like a drastic work around but I'll take wor

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Jeff Newmiller
as.numeric( NULL ) is not silent, it is very explicit. Re this not being a C++ NULL, I don't object to R NULL being used that way (in fact it may be more sensible to do this than not, but it is not clear that R core thinks this way). On April 18, 2018 9:53:12 AM CDT, Serguei Sokol wrote: >Le

Re: [Rcpp-devel] coercion NULL to vector

2018-04-18 Thread Serguei Sokol
Le 18/04/2018 à 17:31, Jeff Newmiller a écrit : as.numeric( NULL ) is not silent, it is very explicit. Well, written in this way yes. But I was referring more to the content than to the form. If you write as.numeric(x) and at some run-time point x become NULL, the code won't stop with an error.

Re: [Rcpp-devel] I'm having trouble installing packages that seem to be related to segfault with Rcpp

2018-04-18 Thread Dirk Eddelbuettel
On 18 April 2018 at 15:14, Shepherd, Lori wrote: | | I updated my g++ and gcc versions and installed the appropriate libgfortran - | | when I tried to overwrite packages / reinstall - it still had ERRORs | | if I completed destroyed my local library and started from scratch the segfaults dis