Como definir e usar variáveis estáticas na classe F#
-
09-06-2019 - |
Pergunta
Existe uma maneira de ter uma variável estática mutável na classe F# que seja idêntica a uma variável estática na classe C#?
Solução
Você usa static let
ligações (nota:embora necessário algumas vezes, não é muito funcional):
type StaticMemberTest () =
static let mutable test : string = ""
member this.Test
with get() =
test <- "asdf"
test
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow