小编Roh*_*han的帖子

SML中的SOME和NONE有哪些选择?

我是SML的新手(实际上是编程).

fun readlist (infile : string) =  

  let
  val 
      ins = TextIO.openIn infile 

      fun loop ins = 

      case TextIO.inputLine ins of 

      SOME line => line :: loop ins 

    | NONE      => [] 

  in 

     loop ins before TextIO.closeIn ins 

  end ;
Run Code Online (Sandbox Code Playgroud)

这是我在这里遇到的一个程序.我如何使用SOME和NONE,以及如何使用'之前'?

sml smlnj

7
推荐指数
2
解决办法
6787
查看次数

标签 统计

sml ×1

smlnj ×1