data Value = VInt Int | VClosure Env Expr
(\x,y -> x+y) 1 2
and the current environment is Gamma then you first have to compute
the left subexpression which is:
(\x,y -> x+y) 1
This is application where function with two arguments is applied to
only one value. The result will be the closure:
Clos (Gamma, x := 1) (\y -> x+y)
The new environment in the closure is our Delta in the evaluation
rule. It has a new binding for x i.e. x := 1 on top of the old
environment Gamma. Now to compute the top-level expression you have to
add the binding for y as well and you will get:
Δ, x := 1, y := 2 ⊢ x+y ⇓ result
If you just use the original environment Gamma you will miss the binding for x.
Krasimir
On Sat, Mar 6, 2010 at 5:29 PM, Erik Levin