[Rcpp-devel] changes in Rcpp today

Romain François francoisromain at free.fr
Tue Dec 29 21:31:20 CET 2009

Right, so trying to cope with the many threads of today. I've commited a 
few changes to Rcpp :

- new namespace Rcpp, which will receive the new API
- the class Rcpp::RObject holds a SEXP and performs operations that are 
doable on any SEXP (manage attributes, garbage collection, etc ...). It 
contains the functionality that was in RcppSexp before
- the template Rcpp::XPtr replaces RcppXPtr, but now extends 
Rcpp::RObject, so that it can concentrate on external pointer stuff and 
leave the generic SEXP management to Rcpp::RObject

I've set up the package so that we can add unit tests using RUnit and 
the Gorjanc/MM/... trick

examples now use the Rcpp namespace where appropriate.

It does not break anything (yet) so code that used to work in Rcpp < 0.7 
still works. RcppSexp and RcppXPtr did get the 5 second rule treatment 

Things on my list:
- rework the examples as regular unit tests
- maybe a vignette
- post on my blog about these
- Rcpp::Function : this will overload operator() so that the object 
looks like a C++ function and will have stuff to deal with the 
environment of a function (closure)
- Rcpp::S4 : things to deal with slots
- Rcpp::Env : (or Rcpp::Environment) retrieve object from the 
environment, ...
- Rcpp::Vector : handling of integer, numeric, raw, character vector 
with for example operator[]. I'll review the Rcpp*Vector classes for that.

All of these can happen before or after we release a new version to 
CRAN. Maybe unit tests should happen though as we already have pretty 
much all the code.

It is late in france now, so that is it for today.


Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
|- http://tr.im/IlMh : CPP package: exposing C++ objects
|- http://tr.im/HlX9 : new package : bibtex
`- http://tr.im/Gq7i : ohloh

More information about the Rcpp-devel mailing list