--- a/src/Pure/ML-Systems/polyml-5.0.ML Thu Dec 28 16:49:35 2006 +0100
+++ b/src/Pure/ML-Systems/polyml-5.0.ML Fri Dec 29 03:57:01 2006 +0100
@@ -14,8 +14,6 @@
local
-fun std_output s = (TextIO.output (TextIO.stdOut, s); TextIO.flushOut TextIO.stdOut);
-
fun use_ml name (print, err) verbose txt =
let
val in_buffer = ref (explode txt);
@@ -28,16 +26,15 @@
(case ! in_buffer of
[] => ""
| c :: cs => (in_buffer := cs; if c = "\n" then line_no := ! line_no + 1 else (); c));
- val put_fn = ref (fn s => out_buffer := s :: ! out_buffer);
+ fun put s = out_buffer := s :: ! out_buffer;
fun exec () =
(case ! in_buffer of
[] => ()
- | _ => (PolyML.compilerEx (get, fn s => ! put_fn s, line, name) (); exec ()));
+ | _ => (PolyML.compilerEx (get, put, line, name) (); exec ()));
in
exec () handle exn => (err (output ()); raise exn);
- if verbose then print (output ()) else ();
- put_fn := std_output (*run-time output, e.g. PolyML.print*)
+ if verbose then print (output ()) else ()
end;
in