src/Pure/ML-Systems/ml_system.ML
author wenzelm
Mon Aug 17 23:45:12 2015 +0200 (2015-08-17 ago)
changeset 60962 faa452d8e265
parent 48416 5787e1c911d0
child 60989 c967d423953a
permissions -rw-r--r--
basic setup for native Windows (RAW session without image);
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@60962
    14
  val platform_is_windows: bool
wenzelm@48416
    15
  val share_common_data: unit -> unit
wenzelm@48416
    16
  val save_state: string -> unit
wenzelm@43948
    17
end;
wenzelm@43948
    18
wenzelm@43948
    19
structure ML_System: ML_SYSTEM =
wenzelm@43948
    20
struct
wenzelm@43948
    21
wenzelm@43948
    22
val SOME name = OS.Process.getEnv "ML_SYSTEM";
wenzelm@43948
    23
val is_polyml = String.isPrefix "polyml" name;
wenzelm@43948
    24
val is_smlnj = String.isPrefix "smlnj" name;
wenzelm@43948
    25
wenzelm@43948
    26
val SOME platform = OS.Process.getEnv "ML_PLATFORM";
wenzelm@43948
    27
val platform_is_cygwin = String.isSuffix "cygwin" platform;
wenzelm@60962
    28
val platform_is_windows = String.isSuffix "windows" platform;
wenzelm@43948
    29
wenzelm@48416
    30
fun share_common_data () = ();
wenzelm@48416
    31
fun save_state _ = raise Fail "Cannot save state -- undefined operation";
wenzelm@48416
    32
wenzelm@43948
    33
end;
wenzelm@43948
    34