1 / 10

Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 . .

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

Download Presentation

Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 . .

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  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

  4. val a = (1, 2) val b = (a, a) val c = (42, ref b, a) 1 Top 2 a b c 42

  5. val a = (1, 2) val b = (a, #2(a)) val c = (42, ref b, a) 1 1 Top 2 a b c 42

  6. 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

  7. val a = 2 val b = (a, a+5) Top a 2 7 b

  8. 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

  9. Val arr = Array.fromList([3, fn(x) => x+1]) Top arr p: x p: x+1 3

  10. Val x = [ref 1, ref 2, ref 3] Val a = hd x Val b = tl x Top x :: :: :: nil 1 2 3 a b

More Related