Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 views
in Technique[技术] by (71.8m points)

smlnj - Increasing the print depth in SML/NJ

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...