3.5 Using the libraries in your applications: an example

3.5.1 The application

The application is a trivial program which reads a line of input and then prints it out prefixed by "The output is: ".

fun get_value () = TextIO.inputLine TextIO.stdIn;

fun show_value x = TextIO.output (TextIO.stdOut, x);

fun run () = let val v = get_value() val s = String.concat ["The output is: ", v] in show_value s end;

As you can see, this program uses the TextIO and String structures from the Basis library.


MLWorks User Guide (UNIX version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker