我试图编写PDC2008简介到F#视频.我在下面显示的代码片段的最后一行中收到错误(演示者没有得到)"错误1此值不是函数,无法应用".我在Visual Studio 2008 shell上运行Fsharp-1.9.6.2.startPrice
最后一行中的符号带有下划线红色,鼠标悬停时出现相同的错误.提前致谢!
type StockAnalyzer (lprices, days) = let prices = lprices |> Seq.map snd |> Seq.take days static member GetAnalyzers (tickers,days) = tickers |> Seq.map loadPrices |> Seq.map (fun prices -> new StockAnalyzer (prices, days)) member s.Return = let lastPrice = prices |> Seq.nth 0 let startPrice = prices |> Seq.nth (days - 1) lastPrice / startPrice -1.
JaredPar.. 5
尝试在" - "和"1"之间加一个空格.F#编译器将-1解释为负值1而不是减1.
尝试在" - "和"1"之间加一个空格.F#编译器将-1解释为负值1而不是减1.