Message-ID: <AANLkTimoEdK_6-3H6eDvitQuYh2fJ5t1K+Nt3B-5-RyO@mail.gmail.com>
Date: 2011-03-10T10:55:08Z
From: Christian Gunning
Subject: [Rcpp-devel] RFC -- Function for making modules ala inline
In-Reply-To: <AANLkTink73GKkm8OhcSw-F1cy54+QH5R8jmB1a9T1aeZ@mail.gmail.com>
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>