See SML full list

前端 未结 3 1099
深忆病人
深忆病人 2021-01-14 06:27

Is there any way to print full list using SML?

Usually what happen is in SML when I have too many elements it prints first few elements separated by \",\" and then i

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 07:02

    Assuming that you are using SML/NJ.

    What you wan't to customize is the reference values in Control.Print. In this case you wan't to change the value of printLength to something larger, for example

    Control.Print.printLength := 100;
    

    In general it is the print* references you wan't to change. However for strings, they chose to call it stringDepth, for some reason.


    Assuming that you are using MosML.

    From the Moscow ML Language Overview, it is described that the Meta unit exposes these two functions (to "control the interactive system")

    val printDepth : int ref  (* limit printed data depth *)
    val printLength : int ref (* limit printed list and vector length *)
    

提交回复
热议问题