SMLNJ 在输出中展开#

发布于 2024-09-19 23:48:39 字数 150 浏览 4 评论 0原文

我有以下内容:

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

有没有办法让 SMLNJ 解释器展开“#”,以便我可以看到确切的数据是什么?谢谢!

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 the exact data is? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在风中等你 2024-09-26 23:48:39

好的。我找到了一个答案:

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

当SML/NJ打印数据结构时,
它只打印该数据结构
一定的深度。在那个深度之下
而是打印 #。这一般是
一件好事,因为数据结构
可以非常大(甚至是循环)。
但是,默认深度
SML/NJ打印数据结构为5,
这通常是不够的。你可以
调整打印深度
数据结构通过输入,
例如,

  • Control.Print.printDepth := 10;

将深度设置为 10。SML/NJ 也可以
缩写列表和字符串
一定的长度。您可以设置长度
通过设置发生这种情况
Control.Print.printLength 和
Control.Print.stringDepth,以某种方式
与上面类似。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文