题
有没有办法在 F# 类中拥有与 C# 类中的静态变量相同的可变静态变量?
解决方案
你用 static let
绑定(注意:虽然有时是必要的,但它不太实用):
type StaticMemberTest () =
static let mutable test : string = ""
member this.Test
with get() =
test <- "asdf"
test
不隶属于 StackOverflow