120 likes | 236 Views
Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3. Top. x. 3. y. z. 3. u. v. 3. Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 val _ = u := 42. Top. x. 3. y. z. 3. u. 42. v. 3. Let val x = 3 val y = x
E N D
Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 . . . Top x 3 y z 3 u v 3
Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 val _ = u := 42 Top x 3 y z 3 u 42 v 3
Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 val _ = u := 42 val _ = v := !u Top x 3 y z 3 u 42 v
val a = (1, 2) val b = (a, a) val c = (42, ref b, a) 1 Top 2 a b c 42
val a = (1, 2) val b = (a, #2(a)) val c = (42, ref b, a) 1 1 Top 2 a b c 42
val a = (1, 2) val b = (a, #2(a)+5) val c = (42, ref b, a) 1 1 Top 2 a 7 b c 42
val a = 2 val b = (a, a+5) Top a 2 7 b
Top Let val s = BAR val t = BAZ 312 val u = QUX (42, ref 211, ref s) val v = nil val w = BAR :: s :: nil s BAR t 3 BAZ u QUX u 42 211 w :: :: BAR nil
Val arr = Array.fromList([3, fn(x) => x+1]) Top arr p: x p: x+1 3
Val x = [ref 1, ref 2, ref 3] Val a = hd x Val b = tl x Top x :: :: :: nil 1 2 3 a b