On 1 January 2010 at 09:35, Romain Fran?ois wrote:
| Hello,
|
| I've commited the two last items I wanted to commit into the new API:
|
| - protect has been reworded to preserve to avoid confusion with
| PROTECT/UNPROTECT. I might add protect/unprotect methods later to allow
| PROTECT/UNPROTECT protection
Cool.
| - I've removed many constructors RObject::RObject and replaced them with
| the set of functions Rcpp::wrap, taking the same arguments and returning
| instances of RObject. The idea is that these constructors do not pollute
| classes that inherit from RObject, and also later when we have a more
| complete API, we can have for example
|
| Rcpp::Double Rcpp::wrap( const double& d )
|
| Double being an extension of RObject dealing specifically with double
| vectors, in which we'll have for example operator[] and iterators so
| that we can apply STL algorithms to R vectors.
|
| but before that we need to release.
|
| Are you happy with Rcpp::wrap or should it be something else. I do not
| mind, but we need to decide before we release. To reduce typing it does
| not even need to be in the Rcpp namespace.
I haven't had a time to look at it in detail. It is sleek in the example I
just adapted to illustrate namespaces. But what I dislike is that just
yesterday I managed to get back to the example from the Dec 20 blog post:
int seed = RcppSexp(s).asInt();
That worked with the typedef. I think that we owe "our users" more constant
behaviour in released interface. Right now wrap() replaces this (and is
arguably nicer) -- but should we not keep the old stuff?