Re: [Rcpp-devel] Is the order of initializations within a data type defined?

2010-03-24 Thread Romain Francois
Le 24/03/10 21:26, Douglas Bates a écrit : > > On Wed, Mar 24, 2010 at 2:47 PM, Dirk Eddelbuettel wrote: >> >> On 24 March 2010 at 13:31, Douglas Bates wrote: >> | I find myself writing code like >> | >> |Rcpp::NumericVector mu(arg); >> |Rcpp::NumericVector eta(mu.size()); >> | ... >> | >>

Re: [Rcpp-devel] Is the order of initializations within a data type defined?

2010-03-24 Thread Douglas Bates
On Wed, Mar 24, 2010 at 2:47 PM, Dirk Eddelbuettel wrote: > > On 24 March 2010 at 13:31, Douglas Bates wrote: > | I find myself writing code like > | > |    Rcpp::NumericVector mu(arg); > |    Rcpp::NumericVector eta(mu.size()); > | ... > | > | because I need to ensure that mu is constructed from

Re: [Rcpp-devel] Is the order of initializations within a data type defined?

2010-03-24 Thread Dirk Eddelbuettel
On 24 March 2010 at 13:31, Douglas Bates wrote: | I find myself writing code like | |Rcpp::NumericVector mu(arg); |Rcpp::NumericVector eta(mu.size()); | ... | | because I need to ensure that mu is constructed from the argument SEXP | before its size can be used to construct eta. Is the

[Rcpp-devel] Is the order of initializations within a data type defined?

2010-03-24 Thread Douglas Bates
I find myself writing code like Rcpp::NumericVector mu(arg); Rcpp::NumericVector eta(mu.size()); ... because I need to ensure that mu is constructed from the argument SEXP before its size can be used to construct eta. Is the order of initializations compiler-dependent or defined by the sta

Re: [Rcpp-devel] anyone familiar with the do_dotcode

2010-03-24 Thread Romain Francois
I'm in the land of second guessing here, but I think the "slicing" occurs because of this typedef: #ifdef __cplusplus typedef SEXP (*VarFun)(...); #else typedef DL_FUNC VarFun; #endif so foo is seen as a VarFun. I don't think what I want is possible... Le 24/03/10 15:22, Romain Francois a écri

[Rcpp-devel] anyone familiar with the do_dotcode

2010-03-24 Thread Romain Francois
Hello, I'd like to be able to simply define functions like this : SEXP foo( IntegerVector x ){ // .. do something with x } instead of this: SEXP foo( SEXP x){ IntegerVector xx(x) ; } and there is something in do_dotcode (I don't know what) that prevents this. With this file :