SMLNJ wants to remove "val it = (): unit" from each print instruction execution

I write sml programs that run on SML / NJ and MLton (non-interactive). When I use print statements in the sml file, SML / NJ always adds

val it = () : unit 

to the exit that clutters the exit. MLton does not.

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

Launch of SML / NJ v110.73.

+3
sml smlnj
source share
1 answer

Without examples of the code that produces this, it is a little difficult to help, however it seems that your β€œproblems” are somewhat related to this question .

In general, do not forget to bind all values ​​of the result to something, so that the variable it not bound to the result:

 val _ = print "fooo" 
+5
source share

All Articles