【发布时间】:2012-04-29 07:31:49
【问题描述】:
我想做这样的事情:
fun f () =
let
fun a() = b()
and
fun b() = a()
in
()
end
其中 a 和 b 是有意义的相互递归函数。但是,这给出了:
Error: syntax error: replacing AND with SEMICOLON
有什么办法吗?
【问题讨论】:
我想做这样的事情:
fun f () =
let
fun a() = b()
and
fun b() = a()
in
()
end
其中 a 和 b 是有意义的相互递归函数。但是,这给出了:
Error: syntax error: replacing AND with SEMICOLON
有什么办法吗?
【问题讨论】:
SML 中相互递归函数的声明由fun ... and ... 块标记:
fun f () =
let
fun a() = b()
and b() = a() (* There is no 'fun' keyword before b() *)
in
()
end
【讨论】: