SMLNJ want to remove “val it = () : unit” from eve

2019-07-03 23:11发布

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.

标签: sml smlnj
1条回答
淡お忘
2楼-- · 2019-07-03 23:37

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"
查看更多
登录 后发表回答