Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (12 sloc) 209 Bytes
1;;
#part 1
type 'a ref = { mutable contents : 'a };;
#part 2
let ref x = { contents = x };;
let (!) r = r.contents;;
let (:=) r x = r.contents <- x;;
#part 3
let x = ref 1;;
!x;;
x := !x + 1;;
!x;;