Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing the print depth in SML/NJ

Tags:

sml

smlnj

I'm trying to get SML/NJ to print out a result at the top level without putting # signs everywhere.

According to some old docs (and a post to this newsgroup on 2001), it should be possible to use Compiler.Control.Print.printDepth

However, on SML/NJ version 110.7, this just gives an error:

- Compiler.Control.Print.printDepth := 100;
stdIn:1.1-30.8 Error: unbound structure: Control in path Compiler.Control.Print.printDepth
like image 878
higherDefender Avatar asked Feb 20 '11 21:02

higherDefender


1 Answers

You might wan't to be more precise in the future. You could for example give some sample output and a link to where you found the above.

If I understand your problem correct, then the last line below is your problem? (code snippet

- datatype tree = leaf | node of int * tree * tree;
datatype tree = leaf | node of int * tree * tree 

- val t = node (1, node (2, node (3, leaf, leaf), leaf), leaf);
val t = node (1,node (2,node #,leaf),leaf) : tree 

Then the Control.Print structure is what you are looking for. So just drop the Compiler part and use

Control.Print.printDepth := 100;

Do note that this is SML/NJ specific and not ml-yacc as such.

like image 169
Jesper.Reenberg Avatar answered Oct 10 '22 01:10

Jesper.Reenberg