Updating exception demo

svn: r442
This commit is contained in:
Jay McCarthy 2005-07-25 18:55:34 +00:00
parent 7650889be0
commit aee4e5b76e
3 changed files with 17 additions and 24 deletions

View File

@ -1,7 +1,10 @@
(require (lib "mztake.ss" "mztake")
(lib "useful-code.ss" "mztake" "private"))
(set-main! "exception.ss")
(printf-b "exception.ss exited? ~a" (process:exited?))
(printf-b "exception.ss exited? ~a" (exited?))
(printf-b "last exception seen: ~a" (hold (process:exceptions)))
(printf-b "last exception seen: ~a" (exceptions))
(set-running! true)

View File

@ -1,16 +0,0 @@
#| This program starts a thread, the thread raises an exception,
this tests how MzTake catches exceptions, even if they come from
anonymous locations.
We don't even need to bind any variables or add any breaks, we just
run the program and catch the exception it throws. |#
(define-mztake-process p ("exception.ss"))
(printf-b "exception.ss exited? ~a" (process:exited? p))
#| Prints out a behavior that tells you whether the debug-process is still running... |#
(printf-b "last exception seen: ~a" (hold (process:exceptions p)))
#| Prints out the last exception that the program threw |#
(start/resume p)

View File

@ -21,12 +21,18 @@
[resume (debug-process? . -> . void?)]
[set-running-e! (frp:event? . -> . void?)]
[set-running! (frp:value-nowable? . -> . void?)]
[rename debug-process-exceptions
process:exceptions
(() (debug-process?) . opt-> . frp:event?)]
[rename debug-process-exited?
process:exited?
(debug-process? . -> . frp:behavior?)])
[exceptions
(() (debug-process?) . opt-> . frp:event?)]
[exited?
(() (debug-process?) . opt-> . frp:behavior?)])
(define exceptions
(opt-lambda ([p (current-process)])
(debug-process-exceptions p)))
(define exited?
(opt-lambda ([p (current-process)])
(debug-process-exited? p)))
#| DISABLED - BROKEN
[process:running? (debug-process? . -> . frp:behavior?)]