[Rcpp-devel] Modules docs
djsamperi at gmail.com
Thu Dec 9 00:23:02 CET 2010
On Wed, Dec 8, 2010 at 6:15 PM, Romain Francois <romain at r-enthusiasts.com>wrote:
> I'm not sure which version of the vignette you are referring to, but the
> one on CRAN (related to Rcpp 0.8.9) recommends to have this in the
> This might be conservative and you might end up importing too much. I don't
> see much of a downside to it.
What I am seeing is that if I load the client package and this package
does not use import(Rcpp), or importClassesFrom(...), or anything like this,
still get correct output from:
And the modules defined by the client package seem to work fine.
Thus it appears that the fact that Rcpp exports the necessary
classes and the client package runs library(Rcpp) is enough.
But perhaps there are situations where this will not work...
> Le 08/12/10 21:21, Dominick Samperi a écrit :
>> To be more concrete, I define a module in foo.cpp and do something like
>> foo = Module("MyClass", PACKAGE="MyPack")
>> Where myfunc() is defined using function() in the RCPP_MODULE macro. I
>> can also extract the underlying reference and work with that as well.
>> This works without the importClassFrom() directive.
>> On Wed, Dec 8, 2010 at 1:55 PM, Dominick Samperi <djsamperi at gmail.com
>> <mailto:djsamperi at gmail.com>> wrote:
>> I have a question about the modules vignette.
>> At the end it says client packages must importClassesFrom(...),
>> and there are comments about using .onLoad() as well.
>> But before reading this I already implemented the use of
>> modules in another (client) package without using these
>> constructions. They do not seem to be required?
>> Can you elaborate on exactly when these constructions
>> are needed?
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
> |- http://bit.ly/fT2rZM : highlight 0.2-5
> |- http://bit.ly/gpCSpH : Evolution of Rcpp code size
> `- http://bit.ly/hovakS : RcppGSL initial release
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel