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.
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:
library( Rcpp )
cppFunction('
struct Silly {
double *v; int k;
};
void hello(int i) { printf("hello, world\n"); }
')
cat("Compiled OK\n")
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.
regards,
/iaw
----
Ivo Welch ([email protected])
On Thu, May 30, 2013 at 10:02 AM, Dirk Eddelbuettel <[email protected]> wrote:
>
> Ivo,
>
> Appreciate that you post here. Am a little pressed for time but in a
> nutshell, you missed that the new (and very nice) Rcpp Attributes which you
> use for sourceCpp do NOT currently mix with Rcpp Modules.
>
> So either concentrate on easily writing accessor function, OR concentrate
> on
> using Modules (which is not th easiest topic to start with). You cannot mix
> and match.
>
> As for simplest examples: they are eg in the package itself, look at
>
> /usr/local/lib/R/site-library/Rcpp/unitTests/testRcppModule/
>
> which provides a small but complete working package using modules.
>
> Hope this helps, Dirk
>
> --
> Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com
>
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel