[Rcpp-devel] today's commits overview
francoisromain at free.fr
Thu Jan 7 21:07:18 CET 2010
On 01/07/2010 08:53 PM, Dirk Eddelbuettel wrote:
> On 7 January 2010 at 14:43, Whit Armstrong wrote:
> | you're on fire!
> | are you working on this full time?
Don't tell anyone.
> Shhhh, don't wake him up! He is in a trance, and if he wakes up, he may
> realize he needs to put food on the table and stop coding....
Yes. I've sacrificed a good chunk of my time for this, and I probably
should not have.
The obsession will stop at some point. we'll see.
It's good learning about R internals anyway. Time for documentation,
anyone wants to step in ?
> | -Whit
> | 2010/1/7 Romain François<francoisromain at free.fr>:
> |> Today has been a Rcpp commit day :-)
> |> We now have classes for most of the SEXP types:
> |> SYMSXP Symbol
> |> LISTSXP Pairlist
> |> CLOSXP Function
> |> ENVSXP Environment
> |> PROMSXP Promise
> |> LANGSXP Language
> |> SPECIALSXP Function
> |> BUILTINSXP Function
> |> LGLSXP LogicalVector
> |> INTSXP IntegerVector
> |> REALSXP NumericVector
> |> CPLXSXP ComplexVector
> |> STRSXP CharacterVector
> |> VECSXP GenericVector a.k.a List
> |> EXPRSXP ExpressionVector
> |> EXTPTRSXP XPtr
> |> WEAKREFSXP WeakReference
> |> RAWSXP RawVector
> |> I have also added methods to deal with S4 objects (in the RObject class
> |> since an S4 object can be of any SEXP type): hasSlot, isS4 and slot.
> |> For GenericVector and CharacterVector, I have implemented the proxy
> |> pattern as described in item 30 of More Effective C++, so that we can do :
> |> CharacterVector x(10) ; /* create a character vector of 10 strings */
> |> x ; /* gets the first element */
> |> x = "foo" ; /* sets the second element */
> |> List y(3) ;
> |> y = 1 ; /* 1 gets wrap()'ed into a IntegerVector */
> |> y = "foo" ; /* foo gets wrap()'ed into a CharacterVector */
> |> y = false ; /* false gets wrap()'ed into a LogicalVector */
> |> As usual, many examples have been added in the unit tests.
> |> Romain
Professional R Enthusiast
+33(0) 6 28 91 30 30
|- http://tr.im/JFqa : R Journal, Volume 1/2, December 2009
|- http://tr.im/IW9B : C++ exceptions at the R level
`- http://tr.im/IlMh : CPP package: exposing C++ objects
More information about the Rcpp-devel