clarified signature;
authorwenzelm
Mon, 12 Apr 2021 22:26:09 +0200
changeset 73571 f86661e32bed
parent 73570 e21aef453cd4
child 73572 6ab97ac63809
clarified signature;
src/Pure/System/scala.scala
src/Pure/library.scala
--- a/src/Pure/System/scala.scala	Mon Apr 12 22:18:37 2021 +0200
+++ b/src/Pure/System/scala.scala	Mon Apr 12 22:26:09 2021 +0200
@@ -39,10 +39,7 @@
   {
     override def multi: Boolean = false
     override def apply(args: List[String]): List[String] =
-      args match {
-        case List(arg) => List(apply(arg))
-        case _ => error("Expected single argument for Scala function " + quote(name))
-      }
+      List(apply(Library.the_single(args)))
     def apply(arg: String): String
   }
 
--- a/src/Pure/library.scala	Mon Apr 12 22:18:37 2021 +0200
+++ b/src/Pure/library.scala	Mon Apr 12 22:26:09 2021 +0200
@@ -275,6 +275,12 @@
       res.toList
     }
 
+  def the_single[A](xs: List[A]): A =
+    xs match {
+      case List(x) => x
+      case _ => error("Single argument expected")
+    }
+
 
   /* proper values */