我试图编写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.
Run Code Online (Sandbox Code Playgroud)