我正在尝试使用SML / NJ,我使用source.sml
来运行代码,但它打印出太多信息。
例如,这是fun fac 0 = 1
| fac n = n * fac (n - 1)
val r = fac 10 ;
print(Int.toString(r));
:
Standard ML of New Jersey v110.77 [built: Tue Mar 10 07:03:24 2015]
- val fac = fn : int -> int
val r = 3628800 : int
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[autoloading done]
3628800val it = () : unit
这是输出:
CM_VERBOSE=false sml < $filename
从Suppress "val it" output in Standard ML,How to disable SMLNJ warnings?和SMLNJ want to remove "val it = () : unit" from every print statement execution,我得到了一些如何抑制它们的提示。
我执行Control.Print.out := {say=fn _=>(), flush=fn()=>()};
并在代码中添加了一行Standard ML of New Jersey v110.77 [built: Tue Mar 10 07:03:24 2015]
- 3628800
,但我仍然有一些消息:
checked
如何只输出输出?