continuing to quickly prototype this.
This commit is contained in:
parent
714eb87844
commit
19a8bc6840
|
@ -3,4 +3,4 @@
|
|||
(declare-implementation
|
||||
#:racket "racket-impl.rkt"
|
||||
#:javascript ("js-impl.js")
|
||||
#:provided-values ())
|
||||
#:provided-values (make-js-world-event))
|
|
@ -1 +1,6 @@
|
|||
#lang s-exp "../../lang/base.rkt"
|
||||
|
||||
(provide make-js-world-event)
|
||||
|
||||
(define (make-js-world-event)
|
||||
(error 'make-js-world-event "Must be run under a JavaScript context."))
|
||||
|
|
16
js/world/test.rkt
Normal file
16
js/world/test.rkt
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang planet dyoo/whalesong
|
||||
(require (planet dyoo/whalesong/js/world))
|
||||
|
||||
(define-values (on-event send-event)
|
||||
(make-js-world-event))
|
||||
|
||||
((js-function (js-eval "function(x) { window.sendTheTick = x; }"))
|
||||
send-event)
|
||||
|
||||
|
||||
(define (handle-event w v)
|
||||
(add1 w))
|
||||
|
||||
(big-bang 0
|
||||
(on-event handle-event)
|
||||
(stop-when (lambda (w) (> w 5))))
|
Loading…
Reference in New Issue
Block a user