我不知道这个错误是什么意思,我从来没有见过它抱怨的行之前是否包含 x -> let 我在此之前使用 match with 但它仍然给我同样的错误。
let rec build (rand,depth) = match depth with
| 0 -> if rand(0,2) == 0 then buildX else buildY
| x -> let r = rand(0, 5) in
if r == 0 then buildSine (build (rand, x -1))
else if r == 1 then buildCosine (build (rand, x -1))
else if r == 2 then buildAverage (build (rand,x -1), build (rand,x-1))
else if r == 3 then buildTimes (build (rand, x -1), build (rand, x-1))
else buildThresh (build(rand, x-1), build(rand, x-1),
build(rand, x-1), build(rand, x-1));;
我的每个构建都返回一个 expr,这应该构建一个大 expr 任何帮助将不胜感激。提前致谢!:D