[Rcpp-devel] extend to cover exporting non-reference S4 objects?

Dirk Eddelbuettel edd at debian.org
Fri Mar 8 04:40:35 CET 2013


On 7 March 2013 at 21:16, Greg Minshall wrote:
| hi.  i'm having a grand time with Rcpp.  (though it's amazing how

Really glad to hear that.  

| annoying procedural+non-REPL languages have become in the last decade
| that i've ignored them! ;-)
| 
| in my application, some of my classes are a good fit for reference
| classes (large arrays).  however, some of my classes are better as
| pass-by-value.

There is also Rcpp::XPtr wrapping around R's external pointers...
 
| currently i implement the pass-by-value classes as S4 objects on the R
| side, and C++ classes on the C++ side, the two sharing the same class
| name, representation, and methods.  this works very well, but the
| inevitable inconsistencies (as the program "evolves") are annoying.
| 
| are there any thoughts to allow non-reference classes to be shared
| between C++ and R?  i would find that a Nice Addition.

No master plan here. 

If you can think of a way to enhance Rcpp with what you dub a "Nice Addition"
without breaking anything else, I am sure we would all be happy to test.

In general, though, it helps to remember that we have to play the hand we've
been dealt.  This is R, and we have precisely _one_ interface via .Call:

     SEXP someFunc(SEXP a, SEXP b, SEXP c, ....)

and there are limits as to what a SEXP can be.  

But don't let that deter you :)
 
| (apologies if this has been discussed on the e-mail list; i searched,
| but nothing jumped out at me.)

Appreciate that you searched.

Cheers, Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list