Last active
August 29, 2015 14:21
-
-
Save bjartwolf/fc7b9408543d1d901039 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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