src/Pure/ML-Systems/polyml.ML
changeset 54717 42c209a6c225
parent 54342 fbcaa9f08879
child 54718 8c5221d698cd
equal deleted inserted replaced
54713:6666fc0b9ebc 54717:42c209a6c225
     1 (*  Title:      Pure/ML-Systems/polyml.ML
     1 (*  Title:      Pure/ML-Systems/polyml.ML
     2     Author:     Makarius
     2     Author:     Makarius
     3 
     3 
     4 Compatibility wrapper for Poly/ML.
     4 Compatibility wrapper for Poly/ML.
     5 *)
     5 *)
       
     6 
       
     7 (* ML system operations *)
       
     8 
       
     9 use "ML-Systems/ml_system.ML";
       
    10 
       
    11 if ML_System.name = "polyml-5.3.0"
       
    12 then use "ML-Systems/share_common_data_polyml-5.3.0.ML"
       
    13 else ();
       
    14 
       
    15 structure ML_System =
       
    16 struct
       
    17 
       
    18 open ML_System;
       
    19 
       
    20 fun share_common_data () = PolyML.shareCommonData PolyML.rootFunction;
       
    21 val save_state = PolyML.SaveState.saveState;
       
    22 
       
    23 end;
       
    24 
     6 
    25 
     7 (* exceptions *)
    26 (* exceptions *)
     8 
    27 
     9 fun reraise exn =
    28 fun reraise exn =
    10   (case PolyML.exceptionLocation exn of
    29   (case PolyML.exceptionLocation exn of
    23 if List.exists (fn s => s = "SingleAssignment") (PolyML.Compiler.structureNames ())
    42 if List.exists (fn s => s = "SingleAssignment") (PolyML.Compiler.structureNames ())
    24 then ()
    43 then ()
    25 else use "ML-Systems/single_assignment_polyml.ML";
    44 else use "ML-Systems/single_assignment_polyml.ML";
    26 
    45 
    27 open Thread;
    46 open Thread;
       
    47 if ML_System.name = "polyml-5.5.2" then ()
       
    48 else use "ML-Systems/thread_physical_processors.ML";
       
    49 
    28 use "ML-Systems/multithreading.ML";
    50 use "ML-Systems/multithreading.ML";
    29 use "ML-Systems/multithreading_polyml.ML";
    51 use "ML-Systems/multithreading_polyml.ML";
    30 
    52 
    31 use "ML-Systems/unsynchronized.ML";
    53 use "ML-Systems/unsynchronized.ML";
    32 val _ = PolyML.Compiler.forgetValue "ref";
    54 val _ = PolyML.Compiler.forgetValue "ref";
    52 val implode = SML90.implode;
    74 val implode = SML90.implode;
    53 
    75 
    54 val io_buffer_size = 4096;
    76 val io_buffer_size = 4096;
    55 
    77 
    56 fun quit () = exit 0;
    78 fun quit () = exit 0;
    57 
       
    58 
       
    59 (* ML system operations *)
       
    60 
       
    61 use "ML-Systems/ml_system.ML";
       
    62 
       
    63 if ML_System.name = "polyml-5.3.0"
       
    64 then use "ML-Systems/share_common_data_polyml-5.3.0.ML"
       
    65 else ();
       
    66 
       
    67 structure ML_System =
       
    68 struct
       
    69 
       
    70 open ML_System;
       
    71 
       
    72 fun share_common_data () = PolyML.shareCommonData PolyML.rootFunction;
       
    73 val save_state = PolyML.SaveState.saveState;
       
    74 
       
    75 end;
       
    76 
    79 
    77 
    80 
    78 (* ML runtime system *)
    81 (* ML runtime system *)
    79 
    82 
    80 fun print_exception_trace (_: exn -> string) = PolyML.exception_trace;
    83 fun print_exception_trace (_: exn -> string) = PolyML.exception_trace;