ăzvan Rotaru <
razvan...@gmail.com> wrote:
> How can I call a native JS function from shen-js?
You have to define a wrapper first:
// a sample of wrapper for 3-place function
Shen.mkfunction("some-func", 3, function f(args) {
if (args.length < 3) return [Shen.type_func, f, 3, args]
return some_func(args[0], args[1], args[2])
})
You can put all required wrappers in a file which you can load from Shen by:
(shenjs.load "wrappers.js")