CodePlexProject Hosting for Open Source Software
Define a class with mutable variable
type BuilderState = | None | Active | Completedtype Builder() = let mutable state = None member this.CurrentState with get() = state member this.Begin() = state <- Active member this.End() = // complete the build process... state <- Completedlet ClassSample2() = let b = Builder() printfn "current state = %A" b.CurrentState b.Begin(); printfn "current state = %A" b.CurrentState b.End(); printfn "current state = %A" b.CurrentState
current state = Nonecurrent state = Activecurrent state = Completed
Last edited Sep 14, 2011 at 2:39 AM by ttliu2000, version 1
There is no recommended release for this project.