Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Romain Francois
Le 22/03/10 23:29, Douglas Bates a écrit : > > On Mon, Mar 22, 2010 at 10:21 AM, Romain Francois > wrote: >> Le 22/03/10 14:14, Douglas Bates a écrit : >>> >>> I think the problem under Linux is extracting fam[0]. The error >>> message to me indicates that even though fam is declared as a >>> Ch

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Douglas Bates
On Mon, Mar 22, 2010 at 10:21 AM, Romain Francois wrote: > Le 22/03/10 14:14, Douglas Bates a écrit : >> >> I think the problem under Linux is extracting fam[0].  The error >> message to me indicates that even though fam is declared as a >> CharacterVector the SEXP it contains isn't a STRSXP. > >

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Romain Francois
Le 22/03/10 14:14, Douglas Bates a écrit : > I think the problem under Linux is extracting fam[0]. The error > message to me indicates that even though fam is declared as a > CharacterVector the SEXP it contains isn't a STRSXP. This is not supposed to happen. The constructor of CharacterVector ma

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Romain Francois
Le 22/03/10 14:30, Dirk Eddelbuettel a écrit : > > On 22 March 2010 at 08:14, Douglas Bates wrote: > |> And when I run the code on OSX (gcc 4.2), I get : > |> > |>*** caught segfault *** > |> address 0x0, cause 'memory not mapped' > |> > |> Traceback: > |>1: .Call("file10d63af1", PACKAGE

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Dirk Eddelbuettel
On 22 March 2010 at 08:14, Douglas Bates wrote: | > And when I run the code on OSX (gcc 4.2), I get : | > | >  *** caught segfault *** | > address 0x0, cause 'memory not mapped' | > | > Traceback: | >  1: .Call("file10d63af1", PACKAGE = f, l) | >  2: fx(binomial()) | > aborting ... | > Segmentatio

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Douglas Bates
On Mon, Mar 22, 2010 at 3:20 AM, Romain Francois wrote: > Le 22/03/10 03:12, Douglas Bates a écrit : >> >> On Sat, Mar 20, 2010 at 2:53 AM, Romain Francois >>  wrote: >>> >>> Hello, >>> >>> The issue with CharacterVector is that the proxy classes : >>> "string_name_proxy" and "string_proxy" only

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-22 Thread Romain Francois
Le 22/03/10 03:12, Douglas Bates a écrit : > On Sat, Mar 20, 2010 at 2:53 AM, Romain Francois > wrote: >> >> Hello, >> >> The issue with CharacterVector is that the proxy classes : >> "string_name_proxy" and "string_proxy" only have implicit conversion to SEXP >> and char* : >> >> operator char*

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-21 Thread Douglas Bates
On Sat, Mar 20, 2010 at 2:53 AM, Romain Francois wrote: > > Hello, > > The issue with CharacterVector is that the proxy classes : > "string_name_proxy" and "string_proxy" only have implicit conversion to SEXP > and char* : > > operator char* (){ >        return get() ; > } > operator SEXP(){ >    

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-20 Thread Romain Francois
Hello, The issue with CharacterVector is that the proxy classes : "string_name_proxy" and "string_proxy" only have implicit conversion to SEXP and char* : operator char* (){ return get() ; } operator SEXP(){ return ::Rf_mkString(get()) ; } i.e. they don't have implicit

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-19 Thread Romain Francois
Le 19/03/10 21:26, Douglas Bates a écrit : > > By the way, I'm sorry for the misleading subject line in my original > post. When I started the message I was trying to extract one of those > functions in the "family" list and create a call. > > > On Fri, Mar 19, 2010 at 3:20 PM, Romain Francois >

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-19 Thread Douglas Bates
By the way, I'm sorry for the misleading subject line in my original post. When I started the message I was trying to extract one of those functions in the "family" list and create a call. On Fri, Mar 19, 2010 at 3:20 PM, Romain Francois wrote: > Hello, > > The following works for me : > > requ

Re: [Rcpp-devel] Extract a function from a list and create a call

2010-03-19 Thread Romain Francois
Hello, The following works for me : require( Rcpp ) require( inline ) fx <- cfunction( signature( data_ = "list" ), ' List data(data_) ; std::string family = data["family"] ; std::string link = data["link"] ; std::cout << "family : " << family << std::endl ; std::cout << "link : " << link