Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Last active August 29, 2015 14:21
Show Gist options
  • Save bjartwolf/fc7b9408543d1d901039 to your computer and use it in GitHub Desktop.
Save bjartwolf/fc7b9408543d1d901039 to your computer and use it in GitHub Desktop.
type Profile (name:string, age:int) =
let id = System.Guid.NewGuid()
let mutable name = name
let mutable age = age
member this.changeAge (newAge: int) =
// crazy business rules
age <- newAge
member this.Id with get () = id
member val Name = name with get, set
member this.Age with get () = age
let p = Profile("Bjørn Einar", 35)
p.Name <- "Bjørn the confused"
p.changeAge(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment