2011-05-19 58 views
5

在F#的PowerPack數學提供源代碼:我看到這個(在lapack_service_netlib.fsF#重複定義

member this.dgemm_((a:matrix),(b:matrix)) = 
// allocate results 
    let c = Matrix.zero (m) (n) 
    // transpose 
    let c = Matrix.transpose c 
... 
    // fixups 
    let c = Matrix.transpose c 
    // result tuple 
    c 

爲什麼這會請編譯? c得到重複的定義?

回答

7

這是遮蔽;在函數/類/成員範圍內,任何本地let綁定將被隨後的let綁定到相同名稱所遮蔽。

另請參閱Shadowing and Nested function

+0

我明白了。不在模塊級別。並始終在fsi.exe中工作。 – ahala 2011-05-20 02:06:41