Open kevinushey opened 10 years ago
The way this is handled in Rcpp
is to somehow convert the c++ code into R code. I think with a bit more logic (with argument matching), we could let C++ do it's thing. In short, in the R layer, or the intermediate c++ generated layer, we'd have to understand how to call the C++ function, and if no parameter is given, then we let C++ use its own default.
So if we call foo( 1L )
then the c++ underlying function is called as foo(1)
, i.e. the default does not come from R but really where it is expressed, in C++.
Eg. Handle things like
These need to be parsed into an appropriate R default argument for the wrapper R function generated from
compileAttributes