src/Pure/ML-Systems/ml_system.ML
author wenzelm
Thu, 17 Dec 2015 17:32:01 +0100
changeset 61862 e2a9e46ac0fb
parent 60989 c967d423953a
permissions -rw-r--r--
support pretty break indent, like underlying ML systems;

(*  Title:      Pure/ML-Systems/ml_system.ML
    Author:     Makarius

ML system and platform operations.
*)

signature ML_SYSTEM =
sig
  val name: string
  val is_polyml: bool
  val is_smlnj: bool
  val platform: string
  val platform_is_windows: bool
  val share_common_data: unit -> unit
  val save_state: string -> unit
end;

structure ML_System: ML_SYSTEM =
struct

val SOME name = OS.Process.getEnv "ML_SYSTEM";
val is_polyml = String.isPrefix "polyml" name;
val is_smlnj = String.isPrefix "smlnj" name;

val SOME platform = OS.Process.getEnv "ML_PLATFORM";
val platform_is_windows = String.isSuffix "windows" platform;

fun share_common_data () = ();
fun save_state _ = raise Fail "Cannot save state -- undefined operation";

end;