# HG changeset patch # User wenzelm # Date 1187283201 -7200 # Node ID 3479a9fe73e0f630480d8c409ed71cbc25057c30 # Parent af8dbc7a23052f311dffce2a1e812c33d6821fce removed signal setup from root function to on-entry hook; diff -r af8dbc7a2305 -r 3479a9fe73e0 lib/scripts/run-polyml-5.0 --- a/lib/scripts/run-polyml-5.0 Thu Aug 16 18:53:21 2007 +0200 +++ b/lib/scripts/run-polyml-5.0 Thu Aug 16 18:53:21 2007 +0200 @@ -52,15 +52,13 @@ EXIT="" fi -ROOT_FUNCTION="fn () => (Signal.signal (2, Signal.SIG_HANDLE (fn _ => Process.interruptConsoleProcesses ())); PolyML.rootFunction ())" - if [ -z "$OUTFILE" ]; then COMMIT='fun commit () = (TextIO.output (TextIO.stdErr, "Error - Database is not opened for writing.\n"); false);' else if [ -z "$COMPRESS" ]; then - COMMIT="fun commit () = (TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", $ROOT_FUNCTION); true);" + COMMIT="fun commit () = (TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", PolyML.rootFunction); true);" else - COMMIT="fun commit () = (PolyML.shareCommonData PolyML.rootFunction; TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", $ROOT_FUNCTION); true);" + COMMIT="fun commit () = (PolyML.shareCommonData PolyML.rootFunction; TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", PolyML.rootFunction); true);" fi [ -f "$OUTFILE" ] && { chmod +w "$OUTFILE" || fail_out; } rm -f "${OUTFILE}.o" || fail_out diff -r af8dbc7a2305 -r 3479a9fe73e0 lib/scripts/run-polyml-5.1 --- a/lib/scripts/run-polyml-5.1 Thu Aug 16 18:53:21 2007 +0200 +++ b/lib/scripts/run-polyml-5.1 Thu Aug 16 18:53:21 2007 +0200 @@ -52,15 +52,13 @@ EXIT="" fi -ROOT_FUNCTION="fn () => (Signal.signal (2, Signal.SIG_HANDLE (fn _ => Process.interruptConsoleProcesses ())); PolyML.rootFunction ())" - if [ -z "$OUTFILE" ]; then COMMIT='fun commit () = (TextIO.output (TextIO.stdErr, "Error - Database is not opened for writing.\n"); false);' else if [ -z "$COMPRESS" ]; then - COMMIT="fun commit () = (TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", $ROOT_FUNCTION); true);" + COMMIT="fun commit () = (TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", PolyML.rootFunction); true);" else - COMMIT="fun commit () = (PolyML.shareCommonData PolyML.rootFunction; TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", $ROOT_FUNCTION); true);" + COMMIT="fun commit () = (PolyML.shareCommonData PolyML.rootFunction; TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", PolyML.rootFunction); true);" fi [ -f "$OUTFILE" ] && { chmod +w "$OUTFILE" || fail_out; } rm -f "${OUTFILE}.o" || fail_out diff -r af8dbc7a2305 -r 3479a9fe73e0 src/Pure/ML-Systems/polyml.ML --- a/src/Pure/ML-Systems/polyml.ML Thu Aug 16 18:53:21 2007 +0200 +++ b/src/Pure/ML-Systems/polyml.ML Thu Aug 16 18:53:21 2007 +0200 @@ -111,7 +111,9 @@ fun eval "-q" = () | eval txt = use_text "" (println, println) false txt; in - val _ = PolyML.onEntry (fn () => app eval (CommandLine.arguments ())); + val _ = PolyML.onEntry (fn () => + (Signal.signal (2, Signal.SIG_HANDLE (fn _ => Process.interruptConsoleProcesses ())); + app eval (CommandLine.arguments ()))); end;