A global environment
A global environment. val a = 15 val b = "foo"; val c = fn (n, p) => p = n * p; val d = [1,2];. Let and local environments. let val a = 20 in hd(d) + a end;. Function expressions generate closures. fun f(x, y) = let fun nested(z) = a + x + z in nested(y) end;.
275 views • 16 slides