Updated the demos for the new syntax.

svn: r128
This commit is contained in:
Jono Spiro 2004-08-03 23:10:12 +00:00
parent 1fc5e1efea
commit c166ef81b4

View File

@ -1,5 +1,8 @@
#| TODO #| TODO
get time-per-event/milliseconds working
(printf-b "~a ms per event" (time-per-event/milliseconds p (changes (hold sin/x-trace))))
implies that the first client created is always the main module implies that the first client created is always the main module
turn script errors into syntax errors turn script errors into syntax errors
@ -125,7 +128,7 @@ Find a way to bind to the result of ananonymous expression: here->(add1 2)
[pause (debug-process? . -> . void?)] [pause (debug-process? . -> . void?)]
[rename debug-process-exceptions [rename debug-process-exceptions
process:exceptions process:exceptions
(debug-process? . -> . frp:behavior?)] (debug-process? . -> . frp:event?)]
[rename runtime/seconds [rename runtime/seconds
process:runtime/seconds process:runtime/seconds
(debug-process? . -> . frp:behavior?)] (debug-process? . -> . frp:behavior?)]
@ -135,7 +138,7 @@ Find a way to bind to the result of ananonymous expression: here->(add1 2)
[rename debug-process-exited? [rename debug-process-exited?
process:exited? process:exited?
(debug-process? . -> . frp:behavior?)] (debug-process? . -> . frp:behavior?)]
[rename time-per-event/milliseconds #;[rename time-per-event/milliseconds
process:time-per-event/milliseconds process:time-per-event/milliseconds
(debug-process? frp:behavior? . -> . frp:behavior?)]) (debug-process? frp:behavior? . -> . frp:behavior?)])
@ -367,7 +370,8 @@ Find a way to bind to the result of ananonymous expression: here->(add1 2)
; run the process ; run the process
(thread-wait (thread (lambda () (run)))) (thread-wait (thread (lambda () (run))))
; program terminates ; program terminates
(kill process)))) (kill process)
(print-info (format "process terminated: ~a" (main-client-name process))))))
; predicate - is the debugee supposed to be running now? ; predicate - is the debugee supposed to be running now?
@ -412,11 +416,13 @@ Find a way to bind to the result of ananonymous expression: here->(add1 2)
(main-client-name process))) (main-client-name process)))
(set-running! process #t)))) (set-running! process #t))))
; Kills and prints out a message stating it
; Kills the debugger process immediately and permanently
(define (kill process) (define (kill process)
(print-info (format "killing debugger for ~a" (main-client-name process))) (print-info (format "killing debugger for ~a" (main-client-name process)))
(stop process))
; Kills the debugger process immediately and permanently
(define (stop process)
; remove the process from the process list ; remove the process from the process list
(set! all-debug-processes (remq process all-debug-processes)) (set! all-debug-processes (remq process all-debug-processes))
@ -474,14 +480,14 @@ Find a way to bind to the result of ananonymous expression: here->(add1 2)
; ; ; ;
(define (running? process) #;(define (running? process)
(script-error "client-running? is broken") (script-error "client-running? is broken")
(and (running-now? process) (and (running-now? process)
(not (debug-process-exited? process)))) (not (debug-process-exited? process))))
(define (time-per-event/milliseconds process behavior) #;(define (time-per-event/milliseconds process behavior)
(truncate (/ (debug-process-runtime process) (frp:lift (truncate (/ (frp:value-now (debug-process-runtime process))
(add1 (count-e (frp:changes behavior)))))) (add1 (frp:value-now (count-e (frp:changes behavior))))))))
(define (runtime/milliseconds process) (define (runtime/milliseconds process)
(debug-process-runtime process)) (debug-process-runtime process))