Skip to content
Snippets Groups Projects
Commit ea08e35f authored by Dan Grossman's avatar Dan Grossman
Browse files

lec01 live code

parent eacd03fa
Branches master
No related tags found
No related merge requests found
(* this is a comment
(* they can even nest *)
*)
#utop_prompt_dummy
let _ = UTop.set_show_box false
(* static environment: empty-ish
dynamic enivornment: empty-ish
*)
(* let variable-name = expression *)
let x = 34
(*
static environment: x : int
dynamic enviornment: x = 34
*)
let y = 17
(*
static environment: x : int, y : int
dynamic enviornment: x = 34, y = 17
*)
(*
+
/ \
+ +
/ \ / \
x y y 2
*)
let z = (x + y) + (y + 2)
(*
static environment: x : int, y : int, z : int
dynamic enviornment: x = 34, y = 17, z = 70
*)
let q = z + 1
let abs_of_z =
if z < 0 then
-z
else
z
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment