0

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

(* 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
4

1 回答 1

1

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

fun funct (a, b::bs) = let val c = a in funct1 (c, a, b::bs) end
于 2012-10-03T09:33:15.267 回答