src/Pure/RAW/ml_system.ML
author wenzelm
Mon, 15 Feb 2016 14:55:44 +0100
changeset 62337 d3996d5873dd
parent 61925 ab52f183f020
child 62354 fdd6989cc8a0
permissions -rw-r--r--
proper syntax;

(*  Title:      Pure/RAW/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;