考虑这个 OCaml 代码:
let coupe_inter i j cases =
let lcases = Array.length cases in
let low,_,_ = cases.(i)
and _,high,_ = cases.(j) in
low,high,
Array.sub cases i (j-i+1),
case_append (Array.sub cases 0 i) (Array.sub cases (j+1) (lcases-(j+1)))
为什么使用表达式let ... and ... in
代替let ... in let ... in
序列(如 F# 强制您这样做)?这种结构在 OCaml 代码中似乎很常见。谢谢!