From cf40b06d697c836a60f593dcc701b3b30bdbe904 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Sun, 4 Mar 2012 18:24:57 -0500 Subject: [PATCH] trying to test out the js binding stuff --- examples/js-binding.rkt | 11 +++++++++++ js/racket-impl.rkt | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 examples/js-binding.rkt diff --git a/examples/js-binding.rkt b/examples/js-binding.rkt new file mode 100644 index 0000000..0a148d1 --- /dev/null +++ b/examples/js-binding.rkt @@ -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) \ No newline at end of file diff --git a/js/racket-impl.rkt b/js/racket-impl.rkt index e12a3ac..6f6c418 100644 --- a/js/racket-impl.rkt +++ b/js/racket-impl.rkt @@ -21,6 +21,9 @@ js-eval load-script + + js-function + js-async-function ) (define (alert x)