Add the abstract syntax tree alternative
Fix Ident Expr. Its syntactic sugar expansion and the semantic equations from part (a) givewhere and . The final step uses left identity from the monad laws and the lookup rule for the newly bound identifier.eval (Fix x e@(Lambda xs body)) rho = result v
where
rho' = extend rho [(x,v)]
v = close e rho'Equivalently, spelling out programming closure construction,The result is a recursive closure, not the result of calling its body. Its self-binding is visible inside that body but does not extend the caller's surrounding semantic environment.