[Rcpp-devel] Modules docs
Romain Francois
romain at r-enthusiasts.com
Thu Dec 9 00:15:28 CET 2010
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
NAMESPACE:
import(Rcpp)
This might be conservative and you might end up importing too much. I
don't see much of a downside to it.
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
> this:
>
> foo = Module("MyClass", PACKAGE="MyPack")
> foo$myfunc()
>
> 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?
>
> Thanks,
> Dominick
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/fT2rZM : highlight 0.2-5
|- http://bit.ly/gpCSpH : Evolution of Rcpp code size
`- http://bit.ly/hovakS : RcppGSL initial release
More information about the Rcpp-devel
mailing list