问题
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