equal
deleted
inserted
replaced
20 val exn_trace: (unit -> 'a) -> 'a |
20 val exn_trace: (unit -> 'a) -> 'a |
21 val debugging: Context.generic option -> ('a -> 'b) -> 'a -> 'b |
21 val debugging: Context.generic option -> ('a -> 'b) -> 'a -> 'b |
22 val controlled_execution: Context.generic option -> ('a -> 'b) -> 'a -> 'b |
22 val controlled_execution: Context.generic option -> ('a -> 'b) -> 'a -> 'b |
23 val toplevel_error: (exn -> unit) -> ('a -> 'b) -> 'a -> 'b |
23 val toplevel_error: (exn -> unit) -> ('a -> 'b) -> 'a -> 'b |
24 val toplevel_program: (unit -> 'a) -> 'a |
24 val toplevel_program: (unit -> 'a) -> 'a |
25 val thread: bool -> (unit -> unit) -> Thread.thread |
|
26 end; |
25 end; |
27 |
26 |
28 structure Runtime: RUNTIME = |
27 structure Runtime: RUNTIME = |
29 struct |
28 struct |
30 |
29 |
164 in raise TOPLEVEL_ERROR end; |
163 in raise TOPLEVEL_ERROR end; |
165 |
164 |
166 fun toplevel_program body = |
165 fun toplevel_program body = |
167 (body |> controlled_execution NONE |> toplevel_error exn_error_message) (); |
166 (body |> controlled_execution NONE |> toplevel_error exn_error_message) (); |
168 |
167 |
169 (*Proof General legacy*) |
|
170 fun thread interrupts body = |
|
171 Thread.fork |
|
172 (fn () => |
|
173 debugging NONE body () handle exn => |
|
174 if Exn.is_interrupt exn then () |
|
175 else writeln ("## INTERNAL ERROR ##\n" ^ exn_message exn), |
|
176 Simple_Thread.attributes interrupts); |
|
177 |
|
178 end; |
168 end; |
179 |
169 |