Rcpp11 / attributes

Standalone implementation of Rcpp attributes.
Other
3 stars 1 forks source link

formals expressed as R code. #36

Open romainfrancois opened 9 years ago

romainfrancois commented 9 years ago

This is somewhat related to RcppCore/Rcpp#190. The idea is to nest default inside C++ comments so that we can express them as R code rather than C++ defaults.

int foo( std::vector<int> x /*= c(1L, 2L) */ ){
    // .... whatever
}

The idea is that the parser recognize /*= and promote that to the formals of the generated R function.

@kevinushey is that something you would tackle since you know a bit more about the internals.

romainfrancois commented 9 years ago

Alternatively, we could think of a way to propagate missingness of an argument instead of converting the default to R code, but I think this would lead to code explosion.