Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想做这样的事情:
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 ... and ...
fun f () = let fun a() = b() and b() = a() (* There is no 'fun' keyword before b() *) in () end