switching over to use browser-evaluate planet package

This commit is contained in:
Danny Yoo 2011-08-18 16:10:48 -04:00
parent 571ccf13bf
commit 9dced96ab2
3 changed files with 12 additions and 5 deletions

2
README
View File

@ -168,7 +168,7 @@ Tests
The test suite in test-all.rkt runs the test suite. You'll need to The test suite in test-all.rkt runs the test suite. You'll need to
run this on a system with a web browser, as the suite will evaluate run this on a system with a web browser, as the suite will evaluate
JavaScript and make sure it is producing values. A bridge module JavaScript and make sure it is producing values. A bridge module
browser-evaluate.rkt brings up a temporary web server that allows us (planet dyoo/browser-evaluate) brings up a temporary web server that allows us
to pass values between Racket and the JavaScript evaluator on the to pass values between Racket and the JavaScript evaluator on the
browser. browser.

View File

@ -1,6 +1,6 @@
#lang racket #lang racket
(require "browser-evaluate.rkt" (require (planet dyoo/browser-evaluate)
"../js-assembler/assemble.rkt" "../js-assembler/assemble.rkt"
"../js-assembler/package.rkt" "../js-assembler/package.rkt"
"../compiler/lexical-structs.rkt" "../compiler/lexical-structs.rkt"
@ -70,9 +70,16 @@
(display "var myInvoke = " op) (display "var myInvoke = " op)
(assemble/write-invoke a-statement op) (assemble/write-invoke a-statement op)
(display ";" op) (display ";" op)
(fprintf op (fprintf op
"return function(succ, fail, params) { myInvoke(MACHINE, function(v) { succ(plt.runtime.toDisplayedString(~a));}, fail, params); }" "return function(succ, fail, params) {
var newParams = { currentDisplayer: function(MACHINE, v) {
params.currentDisplayer(v); } };
myInvoke(MACHINE,
function(v) { succ(plt.runtime.toDisplayedString(~a));},
function(MACHINE, exn) { fail(exn); },
newParams);
}"
inspector) inspector)
(display "})" op)))))) (display "})" op))))))
(define (E-many stmts (inspector "MACHINE.val")) (define (E-many stmts (inspector "MACHINE.val"))

View File

@ -1,5 +1,5 @@
#lang racket #lang racket
(require "browser-evaluate.rkt" (require (planet dyoo/browser-evaluate)
"../js-assembler/package.rkt" "../js-assembler/package.rkt"
"../make/make-structs.rkt") "../make/make-structs.rkt")