[Rcpp-devel] Shared code in C++ files

Dirk Eddelbuettel edd at debian.org
Thu Apr 14 18:24:33 CEST 2016


On 14 April 2016 at 11:55, JJ Allaire wrote:
| I don't know enough about the mechanics of your scenario to comment
| intelligently, but I would in general agree with Dirk that if there is a way to
| put something like this in a package that's the way it ought to be done. You
| could certainly dispatch to different C++ functions within a package using a
| variety of mechanisms including C++ templates, C-style function pointers, etc.
| (the mechanics of doing so for your situation I'm unsure of, but it should be
| possible).

... and even pass user-compiled C++ functions down to compiled code in a
package as demonstrated on RcppDE.

On 14 April 2016 at 11:33, Martin Lysy wrote:
| Would you or Dirk care to weigh in on the appropriate usage of Rcpp for the
| project I described in my previous post?  I realize you are both busy, and
| thank you both again for the time you've taken to answer my query.

Right. I don't really have time to study the particulars of your proposal but
maybe you can consider to just 'trust us' when we say that

  -- you really do want a package
  -- others have done packages for user-facing MCMC / Gibbs (cf Whit's rcppbugs)
  -- you can still allow the user to putz around ad-hoc with sourceCpp.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list