[Rcpp-devel] RFC -- Function for making modules ala inline

Christian Gunning xian at unm.edu
Thu Mar 10 11:55:08 CET 2011


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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modfunction.R
Type: application/octet-stream
Size: 1956 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110310/0ea875c1/attachment.obj>


More information about the Rcpp-devel mailing list