[gambit-list] Javascript Backend

Marc Feeley feeley at iro.umontreal.ca
Thu Mar 6 17:48:32 EST 2014


On Mar 6, 2014, at 2:22 AM, Marc Feeley <feeley at iro.umontreal.ca> wrote:

> For the other way around (exporting a Scheme function callable from JavaScript), the js function can be used like this:
> 
> (define setglo (js "function (name,val) { window[name] = val; }"))
> 
> then
> 
> (setglo "foo" (lambda (n) (* n n)))
> 
> And then in JavaScript land your can call (foo 10).

Ha!  I meant foo(10) of course!

Marc




More information about the Gambit-list mailing list