trying to test out the js binding stuff
This commit is contained in:
parent
60387d58e5
commit
cf40b06d69
11
examples/js-binding.rkt
Normal file
11
examples/js-binding.rkt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#lang planet dyoo/whalesong
|
||||||
|
(require (planet dyoo/whalesong/js))
|
||||||
|
|
||||||
|
(define js-plus
|
||||||
|
(js-function (js-eval "function(x, y) { return x + y; }")))
|
||||||
|
|
||||||
|
(define js-minus
|
||||||
|
(js-function (js-eval "function(x, y) { return x - y; }")))
|
||||||
|
|
||||||
|
"plus: " (js-plus 3 4)
|
||||||
|
"minus:" (js-minus 239748 23)
|
|
@ -21,6 +21,9 @@
|
||||||
js-eval
|
js-eval
|
||||||
|
|
||||||
load-script
|
load-script
|
||||||
|
|
||||||
|
js-function
|
||||||
|
js-async-function
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (alert x)
|
(define (alert x)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user