我是F#的新手,我很想得到一些帮助:)Fsharp - 类型编译错误
我有吗?这个代码编译错误,我不能弄明白:
printfn "Please enter the path for the Jack file/s directory"
let dir = System.Console.ReadLine()
let jackFiles : List<String> = (new List<String>())
dir
|> Directory.GetFiles
|> Seq.iteri(fun file -> if ((Path.GetExtension(file)).Equals(".jack")) then JackFiles.Add(file))
编译器呼喊此错误:
This expression was expected to have type
string->unit
but here has typeunit
有关if ((Path.GetExtension(file)).Equals(".jack")) then JackFiles.Add(file))
部分...
为什么是错的我该如何解决它?
这是正确的....感谢ü非常感谢! – cookya