【发布时间】:2015-02-23 10:10:11
【问题描述】:
我在这段代码中有语法错误,在第二个“try”的“with”中:
let example =
let n = (*Empty_list*) in
while true do
try let i= function (read_line()) in
try let n= execute_inst n i with (*this with*)
|Exception1 s -> print_endline("Exception1 "^s^)
|Exception2 s-> print_endline("Exception2 "^s^)
|Exception3 s -> print_endline("Exception3 "^s^)
|Exception4 -> print_endline("Exception4"); exit 0
with |Exception5 -> print_endline("Exception5")
|Exception6 ->print_endline ("Exception6")
done;;
为什么会这样?
【问题讨论】:
-
您收到的完整错误消息是什么。另外,
let n = (*Empty_list*) in无效...
标签: syntax-error ocaml let try-with