一起使用我无法弄清楚这个错误的含义,我从来没有看到它在 之前所抱怨的那一行是包含x - >让 我之前使用的是匹配,但它仍然给我同样的错误。ocaml错误:该表达式有类型expr,但在这里与类型单元 - > expr
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
没有定义,或者至少是代码片段中所有绑定的声明,很难说。 – didierc