我在交互式窗口http://www.tryfsharp.org中收到此錯誤。它可以在Visual Studio和IM不知道如何解決it.Any幫助罰款,將不勝感激F#交互式窗口問題
let randomNumberGenerator count =
let rnd = System.Random()
List.init count (fun numList -> rnd.Next(0, 100))
let rec sortFunction = function
| [] -> []
| l -> let minNum = List.min l in
let rest = List.filter (fun i -> i <> minNum) l in
let sortedList = sortFunction rest in
minNum :: sortedList
let List = randomNumberGenerator 10
let sortList = sortFunction List
printfn "Randomly Generated numbers in a NON-SORTED LIST\n"
printfn "%A" List
printfn "\nSORTED LIST \n"
printfn "%A \n" sortList
錯誤FS0039:該字段,構造函數或成員
'init'
沒有定義
Aprreciate您幫助
你能粘貼您所得到的是錯誤的代碼? – Ankur 2011-06-02 05:11:23
在第一篇文章中添加的代碼。 – Amp231 2011-06-02 17:44:50