tuned signature: more operations;
authorwenzelm
Sun, 23 Jul 2023 19:20:29 +0200
changeset 78442 c38aebdf1a3d
parent 78441 3153311f0f6c
child 78443 a8e1d9202dd9
tuned signature: more operations;
src/Pure/System/process_result.scala
--- a/src/Pure/System/process_result.scala	Sun Jul 23 18:39:23 2023 +0200
+++ b/src/Pure/System/process_result.scala	Sun Jul 23 19:20:29 2023 +0200
@@ -47,14 +47,13 @@
 
     def merge(rcs: IterableOnce[Int]): Int = rcs.iterator.foldLeft(ok)(merge)
 
+    def apply(ok: Boolean): Int = if (ok) RC.ok else RC.error
+    def apply(exn: Throwable): Int = if (Exn.is_interrupt(exn)) interrupt else error
     def apply(result: Exn.Result[Process_Result]): Int =
       result match {
         case Exn.Res(res) => res.rc
-        case Exn.Exn(Exn.Interrupt()) => interrupt
-        case Exn.Exn(_) => error
+        case Exn.Exn(exn) => apply(exn)
       }
-
-    def apply(ok: Boolean): Int = if (ok) RC.ok else RC.error
   }
 
   val undefined: Process_Result = Process_Result(RC.undefined)