After naively throwing code for an Rcpp module at inline, I realized my mistake and looked inside cxxfunction. Attached is a tested module-creation function that's mostly a subset of cxxfunction. It takes the name of the module as defined in the source file's RCPP_MODULE(modname) (could probably grep for this), and the name of a *file* containing the Module code. Just like cxxfunction, it compiles the code and loads the library. It then loads/attaches/retrieves the module from the library and returns a new Module object.
This function still uses 2 private functions from inline: inline:::addLineNumbers and inline:::compileCode. Since this is Rcpp-specific, it seems like it would fit best in Rcpp, except for it's (circular) dependency on inline. So, the key question is: does this provide added utility and, if so, in which package should it go? Nothing earth-shattering here, but I think this could provide a nice addition to the "rapid prototype" family. best, Christian -- A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!
modfunction.R
Description: Binary data
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
