remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / basis / debugger / threads / threads.factor
blob27ffdc629bbd4453631e51ec8caea9828514139d
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors debugger continuations threads threads.private
4 io io.styles prettyprint kernel math.parser namespaces make ;
5 IN: debugger.threads
7 : error-in-thread. ( thread -- )
8     "Error in thread " write
9     [
10         dup id>> #
11         " (" % dup name>> %
12         ", " % dup quot>> unparse-short % ")" %
13     ] "" make swap write-object ":" print ;
15 M: thread error-in-thread ( error thread -- )
16     initial-thread get-global eq? [
17         die drop
18     ] [
19         global [
20             error-thread get-global error-in-thread. nl
21             print-error nl
22             :c
23             flush
24         ] bind
25     ] if ;
27 [ self error-in-thread stop ]
28 thread-error-hook set-global