--- a/src/Pure/ROOT.scala Fri Feb 24 12:40:40 2023 +0100
+++ b/src/Pure/ROOT.scala Fri Feb 24 20:23:48 2023 +0100
@@ -20,5 +20,6 @@
val proper_bool = Library.proper_bool _
val proper_string = Library.proper_string _
def proper_list[A](list: List[A]): Option[List[A]] = Library.proper_list(list)
+ def if_proper[A](x: Iterable[A], body: => String): String = Library.if_proper(x, body)
}
--- a/src/Pure/library.scala Fri Feb 24 12:40:40 2023 +0100
+++ b/src/Pure/library.scala Fri Feb 24 20:23:48 2023 +0100
@@ -283,6 +283,9 @@
def proper_list[A](list: List[A]): Option[List[A]] =
if (list == null || list.isEmpty) None else Some(list)
+ def if_proper[A](x: Iterable[A], body: => String): String =
+ if (x == null || x.isEmpty) "" else body
+
/* reflection */