开发者

SMLNJ expand # in output

I have the following:

val it = DATAX ("hello",DATAX ("world",DATAX #,DATAX #),...

Is there a way to make the SMLNJ interpreter expand "#" so that I can see what开发者_JS百科 the exact data is? Thanks!


Ok. I found an answer:

http://www.cs.cmu.edu/~me/212/environment.html

When SML/NJ prints a data structure, it prints that data structure only to a certain depth. Beneath that depth it prints a # instead. This is generally a good thing, since data structures can be very large (and even cyclic). However, the default depth to which SML/NJ prints data structures is 5, which is usually not enough. You can adjust the depth to which it prints data structures by entering, for example,

  • Control.Print.printDepth := 10;

to set the depth to 10. SML/NJ also abbreviates lists and strings over a certain length. You can set the length at which this happens by setting Control.Print.printLength and Control.Print.stringDepth, in a manner analogous to the above.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜