<div><br></div>thx, dirk.  first, apologies for multiposting earlier.  I thought it did not allow me to post from my non-registered email address.  second, apologies for the private email.  I wasn't expecting any answers.  just wanted to help with some feedback.  I will buy your Rcpp book when it comes out.<div>

<br></div><div>I think you are correct that modules are too tough for me.  heck, I don't even write R packages.  I am just an end user.  I would have to learn how to write and build those first.  so, I think I will want to go the accessor function route.  can cppFunction() allow me to define structures?  I am just trying something super-simple here:</div>

<div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="courier new, monospace">library( Rcpp )</font></div></div><div><div><font face="courier new, monospace">cppFunction('</font></div>

</div><div><div><font face="courier new, monospace">struct Silly {</font></div></div><div><div><font face="courier new, monospace">  double *v; int k;</font></div></div><div><div><font face="courier new, monospace">};</font></div>

</div><div><div><font face="courier new, monospace">void hello(int i) { printf("hello, world\n"); }</font></div></div><div><div><font face="courier new, monospace">')</font></div></div><div><div><font face="courier new, monospace">cat("Compiled OK\n")</font></div>

</div></blockquote><div><div><br></div><div>but it fails, both on the printf and on the structure definition.  I am wondering whether cppFunction can just handle single functions and without quotation marks.</div><div><br>

</div><div>regards,</div><div><br></div><div>/iaw</div><div><br clear="all"><div><div>----</div><div>Ivo Welch (<a href="mailto:ivo.welch@gmail.com" target="_blank">ivo.welch@gmail.com</a>)</div><div> </div></div>
<br><br><div class="gmail_quote">On Thu, May 30, 2013 at 10:02 AM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Ivo,<br>
<br>
Appreciate that you post here.  Am a little pressed for time but in a<br>
nutshell, you missed that the new (and very nice) Rcpp Attributes which you<br>
use for sourceCpp do NOT currently mix with Rcpp Modules.<br>
<br>
So either concentrate on easily writing accessor function, OR concentrate on<br>
using Modules (which is not th easiest topic to start with). You cannot mix<br>
and match.<br>
<br>
As for simplest examples: they are eg in the package itself, look at<br>
<br>
   /usr/local/lib/R/site-library/Rcpp/unitTests/testRcppModule/<br>
<br>
which provides a small but complete working package using modules.<br>
<br>
Hope this helps,  Dirk<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</font></span></blockquote></div><br></div></div>