[Rcpp-devel] Rcpp Attributes vs Rcpp Modules

Dirk Eddelbuettel edd at debian.org
Sat Jan 3 18:01:42 CET 2015


On 3 January 2015 at 21:22, Fg Nu wrote:
| I recently asked a question about Rcpp Attributes subsuming the
| functionality of the inline package here:
| http://stackoverflow.com/questions/27744383/is-the-inline-package-redundant-yet-for-rcpp
| Dirk confirmed that Rcpp Attributes are fully functional vis-a-vis the
| inline package.

That may not be exactly what I said.  The gist of it is: "Use Attributes".
There is no good reason to use inline, besides re-running older examples.  

[ It so happened that the book went to press when Attributes had just emerged
and is therefore still full of inline examples. Everything else we did for
documentation since then -- notably the Rcpp Gallery is full of use case for
Attributes, as it should be. ]
 
| As a follow on question, I wanted to know when, if ever, Rcpp
| Attributes can fully replace the use of Rcpp Modules. I am aware that
| Rcpp Attributes can be used to export standalone functions, but as
| mentioned in the Rcpp Modules vignette
| (http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf):
| 
| "[...] but read on for Rcpp modules which contains to provide features
| not covered by Rcpp attributes, particularly when it comes to binding
| entire C++ classes and more."
| 
| it cannot export entire class definitions. Is this planned
| functionality? What are the challenges to implementing this using
| Attributes? What are some of the other things that Modules can do that
| Attributes cannot?

Attributes can be used with Modules.  Just place your Modules code in a file
and sourceCpp() it.

Will Attributes and inline overlap, Modules is a little different and can be
used with either.

Dirk

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


More information about the Rcpp-devel mailing list