# HG changeset patch # User wenzelm # Date 1678540736 -3600 # Node ID b619d80f61fa00f4eb191d58f50665de094a75f1 # Parent 44f7b76d110672dcb338da6aee0532c7e8f54909 clarified signature; diff -r 44f7b76d1106 -r b619d80f61fa src/Pure/ROOT.scala --- a/src/Pure/ROOT.scala Sat Mar 11 13:37:58 2023 +0100 +++ b/src/Pure/ROOT.scala Sat Mar 11 14:18:56 2023 +0100 @@ -25,4 +25,5 @@ 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) + def if_proper(b: Boolean, body: => String): String = Library.if_proper(b, body) } diff -r 44f7b76d1106 -r b619d80f61fa src/Pure/System/options.scala --- a/src/Pure/System/options.scala Sat Mar 11 13:37:58 2023 +0100 +++ b/src/Pure/System/options.scala Sat Mar 11 14:18:56 2023 +0100 @@ -250,7 +250,7 @@ override def toString: String = iterator.mkString("Options(", ",", ")") private def print_entry(opt: Options.Entry): String = - if (opt.public) "public " + opt.print else opt.print + if_proper(opt.public, "public ") + opt.print def print: String = cat_lines(iterator.toList.sortBy(_.name).map(print_entry)) diff -r 44f7b76d1106 -r b619d80f61fa src/Pure/library.scala --- a/src/Pure/library.scala Sat Mar 11 13:37:58 2023 +0100 +++ b/src/Pure/library.scala Sat Mar 11 14:18:56 2023 +0100 @@ -292,6 +292,9 @@ def if_proper[A](x: Iterable[A], body: => String): String = if (x == null || x.isEmpty) "" else body + def if_proper(b: Boolean, body: => String): String = + if (!b) "" else body + /* reflection */