Each binding of a variable to a value, as in the following, creates a new instance of a variable. After the second one, any direct referene to x yields the integer 4. Thus far, in ML, there is NO concept of assigning values over and over to the same variable. Each val or fun declaration binds a new name to a value. Suppose we define variable m, as shown below.
Variable m is bound to a reference to an integer.
Run what you see below and see what comes out. You probably don't want to do this. Then expression ref e has type t ref. Each time reset if called, it sets the counter to 0 and returns the empty tuple. So ML thus far has almost given us objects, with state, which can be changed.