SML FAQ

This page will provide questions and answers relating to the programming in SML and using the SML/NJ compiler. See also the SML/NJ FAQ page, but be aware that this page assumes SML/NJ 110.0.7 and there will be some minor differences in 110.42.

Printing

1. Question: The interactive system prints values to a limited depth, substituting the symbol "#" for the missing parts. How do I force the system to print the complete value?

Answer: The variable

    Control.Print.printDepth : int ref
controls the depth of value printing, and it has a default value of 5. To print the full value, set this variable to some large value:
    Control.Print.printDepth := 1000;
The top-level also truncates the printing of long lists, by default after 12 elements. This is controlled by the variable:
    Control.Print.printLength: int ref
which can also be reset by assignment.

In SML/NJ 110.0.7, the path to this structure is Compiler.Control.Print.

For further documentation of the Print structure, see its manual page.


Dave MacQueen
Last modified: Tue Apr 8 15:31:04 CDT 2003