SMLNJ want to remove “val it = () : unit” from every print statement execution

余生长醉 提交于 2019-12-10 21:07:46

问题


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.


回答1:


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"


来源:https://stackoverflow.com/questions/8434592/smlnj-want-to-remove-val-it-unit-from-every-print-statement-execution

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