F# “为什么?”-1“;不能减去1吗?

F# “为什么?”-1“;不能减去1吗?,f#,pdc2008,F#,Pdc2008,我试着用代码来处理这个问题。我在下面显示的代码片段的最后一行(演示者没有得到)中得到一个错误:“错误1此值不是函数,无法应用”。我正在VisualStudio2008shell上运行Fsharp-1.9.6.2。最后一行中的startPrice符号带红色下划线,鼠标悬停时出现相同错误。提前谢谢 type StockAnalyzer (lprices, days) = let prices = lprices |> Seq.map snd

我试着用代码来处理这个问题。我在下面显示的代码片段的最后一行(演示者没有得到)中得到一个错误:“错误1此值不是函数,无法应用”。我正在VisualStudio2008shell上运行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.

尝试在“-”和“1”之间加一个空格。F#编译器将-1解释为一个负值,而不是减法1