Mercurial > pub > dyncall > bindings
view R/rdyncall/demo/factorial.R @ 61:c5a69c454963
- allow use of 'None' with 'Z'
- bumped version to 1.4 (be in sync current dyncall version)
author | Tassilo Philipp |
---|---|
date | Mon, 03 Apr 2023 19:06:07 +0200 |
parents | 0cfcc391201f |
children |
line wrap: on
line source
f <- function(i,fun) { if (i > 1) i * .dyncall(fun,"ip)i",i-1,fun) else i } e <- new.env() cb <- new.callback("ip)i", f,e) e <- NULL f <- NULL gc() r <- .dyncall(cb,"ip)i",12,cb) r == factorial(12) cb <- NULL gc()