Próbuję użyć SML/NJ i używam sml < source.sml
do uruchomienia kodu, ale drukuje on za dużo informacji.Drukowanie tylko wydruku za pomocą SML/NJ
Na przykład, jest to source.sml
:
fun fac 0 = 1
| fac n = n * fac (n - 1)
val r = fac 10 ;
print(Int.toString(r));
To wyjście:
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
Od Suppress "val it" output in Standard ML, How to disable SMLNJ warnings? i SMLNJ want to remove "val it =() : unit" from every print statement execution, mam kilka wskazówek, jak je stłumić.
mogę wykonać CM_VERBOSE=false sml < $filename
i dodaje jedną linię Control.Print.out := {say=fn _=>(), flush=fn()=>()};
w kodzie, ale nadal mam pewne wiadomość:
Standard ML of New Jersey v110.77 [built: Tue Mar 10 07:03:24 2015]
- 3628800
Jak mogę wydrukować tylko wyjście?