SMLNJ expand # in output

大憨熊 提交于 2019-12-02 08:17:55

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!