alice
library
manual.

Alice Project

The Print structure


________ Synopsis ____________________________________________________

    signature PRINT
    structure Print : PRINT

This structure provides generic printers for values and types. It is solely intended as a debugging aid.


________ Import ______________________________________________________

    import structure Print from "x-alice:/lib/system/Print"
    import signature PRINT from "x-alice:/lib/system/PRINT-sig"

In the interactive toplevel the functions printVal and printType are available unqualified.


________ Interface ___________________________________________________

    signature PRINT =
    sig
	val printWidth : int ref

	val printVal :   'a -> unit
	val printType :  'a -> unit
	val outputVal :  TextIO.outstream * 'a * int -> unit
	val outputType : TextIO.outstream * 'a * int -> unit
    end
  

________ Description _________________________________________________

printWidth

Controls the width of the output as performed by printVal and printType, i.e. the maximum number of characters on each line.

outputVal (strm, x, w)
printVal x

Pretty prints the value x to the stream strm in ML syntax. If the output exceeds w characters, output is broken into multiple lines appropriately.

The second form is equivalent to:

      outputVal (TextIO.stdOut, x, !printWidth)
outputType (strm, x, w)
printType x

Pretty prints the type of value x to the stream strm in ML syntax. If the output exceeds w characters, output is broken into multiple lines appropriately.

The second form is equivalent to:

      outputType (TextIO.stdOut, x, !printWidth)


last modified 1970/01/01 01:00