diff --git a/collects/mztake/demos/exception/exception-mztake-uncommented.ss b/collects/mztake/demos/exception/exception-mztake-uncommented.ss index c741712b36..24506c3964 100644 --- a/collects/mztake/demos/exception/exception-mztake-uncommented.ss +++ b/collects/mztake/demos/exception/exception-mztake-uncommented.ss @@ -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) \ No newline at end of file diff --git a/collects/mztake/demos/exception/exception-mztake.ss b/collects/mztake/demos/exception/exception-mztake.ss deleted file mode 100644 index 339b07254f..0000000000 --- a/collects/mztake/demos/exception/exception-mztake.ss +++ /dev/null @@ -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) \ No newline at end of file diff --git a/collects/mztake/mztake.ss b/collects/mztake/mztake.ss index eebb2fc5d0..539ed48ae2 100644 --- a/collects/mztake/mztake.ss +++ b/collects/mztake/mztake.ss @@ -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?)]