Hi, I'd like to dynamically add functions to a module when I call one of its function. Later I will want to do the same for classes too, so that to create classes "on the fly".
But for the moment, here is what I try to do and it doesn't work, because I can't see my dynamically created function in R #include <Rcpp.h> using namespace Rcpp; double foobar(int x) { return x*2.0; } void makef() { function("dynfoo",&foobar); } RCPP_MODULE(test1) { function("foobar",foobar); function("makef",&makef); } Then in R, I call the function makef hoping to see the function dynfoo appears in my global environment in R. It's not the case. I suspect a problem with scope (or something like that) ? - What is the correct way to do that ? - Can I create my functions in other environment too ? Best, David
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel