SMLNJ 希望删除“val it = () : unit”从每个打印语句执行

发布于 2024-12-20 06:40:44 字数 240 浏览 3 评论 0原文

我正在编写在 SML/NJ 和 MLton 上运行的 sml 程序(非交互式)。当我在 sml 文件中使用 print 语句时,SML/NJ 总是添加

val it = () : unit 

到输出中,这会使输出变得混乱。 MLton 不这样做。

有没有办法删除这个输出?我尝试过 CM_VERBOSE=false,但没有帮助。

运行 SML/NJ v110.73。

I am writing sml programs which run on SML/NJ and MLton (not interactive). When I use print statements in the the sml file, SML/NJ always adds

val it = () : unit 

to the output, which clutters up the output. MLton does not do this.

Is there a way to remove this output? I have tried CM_VERBOSE=false, which did not help.

Running SML/NJ v110.73.

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

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

发布评论

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

评论(1

独自←快乐 2024-12-27 06:40:44

如果没有生成此代码的代码示例,则很难提供帮助,但是您的“问题”似乎与此问题

总之,请记住将所有结果值绑定到某些内容,这样 it 变量就不会分配给结果:

val _ = print "fooo"

Without examples of the code that produces this, it is a bit hard to help, however it seems that your "issues" are somewhat related to this question.

In summary, remember to bind all result values to something, such that the it variable don't get assigned to the result:

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