【问题标题】:Why does the following function not end?为什么下面的函数没有结束?
【发布时间】:2012-10-04 05:32:35
【问题描述】:

为什么下面的函数没有结束?

(* funct1 is a different function that does end *)
fun funct(a,b::bs)=let val c=a in funct1(c,a,b::bs); 
= ;
= ;
= ;
= ;
stdIn:15.54-17.2 Error: syntax error: deleting  SEMICOLON SEMICOLON SEMICOLON

【问题讨论】:

    标签: sml smlnj


    【解决方案1】:

    在这种情况下,错误消息确实很有指导意义。该函数没有结束,因为您需要end 关键字而不是;。这是 SML 中 let...in...end 块的语法。

    fun funct (a, b::bs) = let val c = a in funct1 (c, a, b::bs) end
    

    【讨论】:

      猜你喜欢
      • 2020-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-07
      • 2020-09-24
      • 2016-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多