src/Pure/ML-Systems/ml_system.ML
author wenzelm
Tue Mar 25 13:18:10 2014 +0100 (2014-03-25 ago)
changeset 56275 600f432ab556
parent 48416 5787e1c911d0
child 60962 faa452d8e265
permissions -rw-r--r--
added command 'SML_file' for Standard ML without Isabelle/ML add-ons;
wenzelm@43948
     1
(*  Title:      Pure/ML-Systems/ml_system.ML
wenzelm@43948
     2
    Author:     Makarius
wenzelm@43948
     3
wenzelm@48416
     4
ML system and platform operations.
wenzelm@43948
     5
*)
wenzelm@43948
     6
wenzelm@43948
     7
signature ML_SYSTEM =
wenzelm@43948
     8
sig
wenzelm@43948
     9
  val name: string
wenzelm@43948
    10
  val is_polyml: bool
wenzelm@43948
    11
  val is_smlnj: bool
wenzelm@43948
    12
  val platform: string
wenzelm@43948
    13
  val platform_is_cygwin: bool
wenzelm@48416
    14
  val share_common_data: unit -> unit
wenzelm@48416
    15
  val save_state: string -> unit
wenzelm@43948
    16
end;
wenzelm@43948
    17
wenzelm@43948
    18
structure ML_System: ML_SYSTEM =
wenzelm@43948
    19
struct
wenzelm@43948
    20
wenzelm@43948
    21
val SOME name = OS.Process.getEnv "ML_SYSTEM";
wenzelm@43948
    22
val is_polyml = String.isPrefix "polyml" name;
wenzelm@43948
    23
val is_smlnj = String.isPrefix "smlnj" name;
wenzelm@43948
    24
wenzelm@43948
    25
val SOME platform = OS.Process.getEnv "ML_PLATFORM";
wenzelm@43948
    26
val platform_is_cygwin = String.isSuffix "cygwin" platform;
wenzelm@43948
    27
wenzelm@48416
    28
fun share_common_data () = ();
wenzelm@48416
    29
fun save_state _ = raise Fail "Cannot save state -- undefined operation";
wenzelm@48416
    30
wenzelm@43948
    31
end;
wenzelm@43948
    32