Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cml/src/glue/run-cml-fn.sml
ViewVC logotype

Diff of /sml/trunk/src/cml/src/glue/run-cml-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 843, Tue Jun 19 21:53:04 2001 UTC revision 844, Wed Jun 20 20:39:15 2001 UTC
# Line 24  Line 24 
24      structure Sig = Signals      structure Sig = Signals
25      structure CU = CleanUp      structure CU = CleanUp
26    
27        open InitCleanup    (* to force CM to link this module in *)
28    
29      structure E = ExportFnFn (G);      structure E = ExportFnFn (G);
30    
31      open CU      open CU
# Line 36  Line 38 
38            then SMLofNJ.Cont.throw (! S.shutdownHook) (true, sts)            then SMLofNJ.Cont.throw (! S.shutdownHook) (true, sts)
39            else raise Fail "CML is not running"            else raise Fail "CML is not running"
40    
41      (* a dummy print function, in case the user's program doesn't reference
42       * CML's TextIO structure directly.
43       *)
44        fun dummyPrint _ = raise Fail "print called without loading CML's TextIO"
45    
46      val interruptK : unit SMLofNJ.Cont.cont =      val interruptK : unit SMLofNJ.Cont.cont =
47            SMLofNJ.Cont.isolate (fn _ => shutdown OS.Process.failure)            SMLofNJ.Cont.isolate (fn _ => shutdown OS.Process.failure)
# Line 55  Line 61 
61                  ignore (                  ignore (
62                    Sig.setHandler (Sig.sigINT, Sig.HANDLER(fn _ => interruptK)));                    Sig.setHandler (Sig.sigINT, Sig.HANDLER(fn _ => interruptK)));
63                  S.shutdownHook := doneK;                  S.shutdownHook := doneK;
64                    SMLofNJ.Internals.prHook := dummyPrint;
65                  case tq of (SOME tq) => S.startTimer tq | _ => S.restartTimer();                  case tq of (SOME tq) => S.startTimer tq | _ => S.restartTimer();
66                  CU.clean CU.AtInit;                  CU.clean CU.AtInit;
67                  CML.spawn initialProc;                  CML.spawn initialProc;
# Line 86  Line 93 
93          (* unlink the SML print function *)          (* unlink the SML print function *)
94            SMLofNJ.Internals.prHook := (fn _ => ());            SMLofNJ.Internals.prHook := (fn _ => ());
95          (* unlink the perv structure *)          (* unlink the perv structure *)
96            Unsafe.pStruct := Unsafe.NILrde;            Unsafe.pStruct := Unsafe.Object.toObject ();
97          (* now export the wrapped main function *)          (* now export the wrapped main function *)
98            exportFn' (fileName, E.wrapForExport (main, timeQ)))            exportFn' (fileName, E.wrapForExport (main, timeQ)))
99    

Legend:
Removed from v.843  
changed lines
  Added in v.844

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0