<br><br><div class="gmail_quote">On Wed, Dec 8, 2010 at 6:15 PM, Romain Francois <span dir="ltr">&lt;<a href="mailto:romain@r-enthusiasts.com">romain@r-enthusiasts.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I&#39;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:<br>
<br>
import(Rcpp)<br>
<br>
This might be conservative and you might end up importing too much. I don&#39;t see much of a downside to it.<br></blockquote><div><br>What I am seeing is that if I load the client package and this package<br>does not use import(Rcpp), or importClassesFrom(...), or anything like this, I<br>
still get correct output from:<br><br>showClass(&#39;Module&#39;)<br>showClass(&#39;C++Class&#39;)<br>etc.<br><br>And the modules defined by the client package seem to work fine.<br><br>Thus it appears that the fact that Rcpp exports the necessary<br>
classes and the client package runs library(Rcpp) is enough.<br><br>But perhaps there are situations where this will not work...<br><br>Thanks,<br>Dominick<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
Le 08/12/10 21:21, Dominick Samperi a écrit :<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
To be more concrete, I define a module in foo.cpp and do something like<br>
this:<br>
<br>
foo = Module(&quot;MyClass&quot;, PACKAGE=&quot;MyPack&quot;)<br>
foo$myfunc()<br>
<br>
Where myfunc() is defined using function() in the RCPP_MODULE macro. I<br>
can also extract the underlying reference and work with that as well.<br>
<br>
This works without the importClassFrom() directive.<br>
<br>
On Wed, Dec 8, 2010 at 1:55 PM, Dominick Samperi &lt;<a href="mailto:djsamperi@gmail.com" target="_blank">djsamperi@gmail.com</a><br></div><div class="im">
&lt;mailto:<a href="mailto:djsamperi@gmail.com" target="_blank">djsamperi@gmail.com</a>&gt;&gt; wrote:<br>
<br>
    I have a question about the modules vignette.<br>
<br>
    At the end it says client packages must importClassesFrom(...),<br>
    and there are comments about using .onLoad() as well.<br>
<br>
    But before reading this I already implemented the use of<br>
    modules in another (client) package without using these<br>
    constructions. They do not seem to be required?<br>
<br>
    Can you elaborate on exactly when these constructions<br>
    are needed?<br>
<br>
    Thanks,<br>
    Dominick<br>
</div></blockquote>
<br>
<br>
-- <br>
Romain Francois<br>
Professional R Enthusiast<br>
+33(0) 6 28 91 30 30<br>
<a href="http://romainfrancois.blog.free.fr" target="_blank">http://romainfrancois.blog.free.fr</a><br>
|- <a href="http://bit.ly/fT2rZM" target="_blank">http://bit.ly/fT2rZM</a> : highlight 0.2-5<br>
|- <a href="http://bit.ly/gpCSpH" target="_blank">http://bit.ly/gpCSpH</a> : Evolution of Rcpp code size<br>
`- <a href="http://bit.ly/hovakS" target="_blank">http://bit.ly/hovakS</a> : RcppGSL initial release<br>
<br>
<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</blockquote></div><br>