因此我在OCaml中调试时遇到了问题。问题是我正在编写非常简单的代码,但我一直在收到一个似乎很容易解决的问题 - 我只是不知道该怎么做!OCaml中的“Unexpected Tokens”和调试
let rec multiplier (int1: int) (int2: int) (int3: int) : int =
let product : int
if int1 >= int2 then(
if int1 >= int3 then product = int1 * int2
else product = int1 * int3
)
else if int2 >= int1 then(
if int1 >= int3 then product = int2 * int1
else product = int2 * int3
)
我不断收到下一个红色的“X”和squigley行的第一个“如果”出现错误:“意外令牌:如果”
谢谢!
你的麻烦是不是在调试ocaml的,它是了解Ocaml程序编写的概念和句法。干净地编译之前,您没有开始调试您的程序。 –