You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the exportR pragma should make sure that the procedure is wrapped into another Nim procedure:
procfooImpl(xImpl, yImpl: SEXP)
let x = xImpl.to(int)
let y = yImpl.to(NumericVector[float])
# ... original body
this way we can have native Nim types as arguments and let the user avoid doing the conversions, somewhat similar to Rcpp.
For scalar types copying the data is fine. For other types (e.g. vectors etc.) we want Nim wrapper types e.g. NumericVector[T], which keeps track internally of the underlying SEXP data. This is similar to what Rcpp does as well.
The text was updated successfully, but these errors were encountered:
Assuming we had something like:
the
exportR
pragma should make sure that the procedure is wrapped into another Nim procedure:this way we can have native Nim types as arguments and let the user avoid doing the conversions, somewhat similar to Rcpp.
For scalar types copying the data is fine. For other types (e.g. vectors etc.) we want Nim wrapper types e.g.
NumericVector[T]
, which keeps track internally of the underlyingSEXP
data. This is similar to what Rcpp does as well.The text was updated successfully, but these errors were encountered: