Skip to content
Prev 2766 / 10988 Next

[Rcpp-devel] Parameter Naming

Hello Dirk,
Thanks for the reply. What I meant was "badName" and "x" should be the
same, because using two names for the same thing makes the code harder
to understand and maintain (*). So either this:

goodDemo <- cxxfunction(signature(goodName_="integer"), plugin='Rcpp',
body='
      Rcpp::IntegerVector goodName(goodName_);
      return 2*goodName;
   ')

or this:

nearlyAsGoodDemo <- cxxfunction(signature(x_="integer"), plugin='Rcpp',
body='
      Rcpp::IntegerVector x(x_);
      return 2*goodName;
   ')

Darren

*: I'm still amazed at how much "throw-away" code, that I was told was
only needed to run for a month, or even for a one-off data import, I end
up still maintaining 3 or 4 years later; I sometimes wonder if my
clients are deliberately lying to me about their intentions ;-)