开发者

f# duplicate definition

开发者 https://www.devze.com 2023-03-07 06:46 出处:网络
in F# powerpack math provider source code: I saw this (in lapack_service_netlib.fs) member this.dgemm_((a:matrix),(b:matrix)) =

in F# powerpack math provider source code: I saw this (in lapack_service_netlib.fs)

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

Why does this com开发者_开发技巧plile? does c get duplicate definition?


This is shadowing; at function/class/member scope, any local let bindings will be shadowed by subsequent let bindings to the same name.

See also Shadowing and Nested function

0

精彩评论

暂无评论...
验证码 换一张
取 消