Examples
- val v = ref 0;
val v = ref 0 : int ref
- v := !v + 1;
() : unit
- !v;
1 : int
A major difference from Scheme is that the mutable objects are stated explicitly
In Scheme, set! can be used anywhere, anytime
Previous slide
Next slide
Back to first slide
View graphic version