【发布时间】:2014-03-15 18:44:06
【问题描述】:
我正在尝试创建一个将元组与元组数组的值进行比较的函数。我需要这个来返回一个布尔值,但 VS2013 一直告诉我: "这个表达式应该有'unit'类型,但有'bool'类型"
let compare (i,j,a,(x : (int*int*int) array)) =
for q in 0 .. x.GetLength(0) do
match (i,j,a,x) with
| (i,j,a,x) when (i,j,a) = x.[q] -> true
| _ -> false
也尝试将值作为两个参数给出,但它也不起作用:
let compare (i,j,a) (x : (int*int*int) array) =
for q in 0 .. x.GetLength(0) do
match (i,j,a) with
| x.[q] -> true
| _ -> false
任何帮助将不胜感激!
【问题讨论】: