clarified signature;
authorwenzelm
Wed, 30 Sep 2020 23:31:18 +0200
changeset 72349 e7284278796b
parent 72348 7d3a96acae28
child 72350 95c2853dd616
clarified signature;
src/Pure/System/isabelle_platform.scala
--- a/src/Pure/System/isabelle_platform.scala	Wed Sep 30 23:08:57 2020 +0200
+++ b/src/Pure/System/isabelle_platform.scala	Wed Sep 30 23:31:18 2020 +0200
@@ -35,6 +35,8 @@
             }))
     }
   }
+
+  lazy val self: Isabelle_Platform = apply()
 }
 
 class Isabelle_Platform private(val settings: List[(String, String)])
@@ -49,9 +51,17 @@
   val ISABELLE_WINDOWS_PLATFORM32: String = get("ISABELLE_WINDOWS_PLATFORM32")
   val ISABELLE_WINDOWS_PLATFORM64: String = get("ISABELLE_WINDOWS_PLATFORM64")
 
-  val is_linux: Boolean = ISABELLE_PLATFORM_FAMILY == "linux"
-  val is_macos: Boolean = ISABELLE_PLATFORM_FAMILY == "macos"
-  val is_windows: Boolean = ISABELLE_PLATFORM_FAMILY == "windows"
+  def is_intel: Boolean =
+    ISABELLE_PLATFORM32.startsWith("x86-") ||
+    ISABELLE_PLATFORM64.startsWith("x86_64-")
+
+  def is_arm: Boolean =
+    ISABELLE_PLATFORM32.startsWith("arm32-") ||
+    ISABELLE_PLATFORM64.startsWith("arm64-")
+
+  def is_linux: Boolean = ISABELLE_PLATFORM_FAMILY == "linux"
+  def is_macos: Boolean = ISABELLE_PLATFORM_FAMILY == "macos"
+  def is_windows: Boolean = ISABELLE_PLATFORM_FAMILY == "windows"
 
   override def toString: String = ISABELLE_PLATFORM_FAMILY
 }