0

このエラーが何を意味するのかわかりません。問題のある行の前に x を含む行があるかどうかを見たことがありません - >これの前に 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 を返し、これは 1 つの大きな expr をビルドすることになっています。前もって感謝します!:D

4

1 に答える 1

3

おそらくbuildXbuildY議論をすることになっていますか?

# let f () = 14;;
val f : unit -> int = <fun>
# f ;;
- : unit -> int = <fun>
# f ();;
- : int = 14
于 2013-01-25T00:13:08.523 に答える