X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=code%2Freduction_with_closures.ml;fp=code%2F_reduction_with_environments.ml;h=dc3d8fa284b186fe60eab63bf62e4b0073d212f8;hp=db406c75c0d73a7f43a27e6e7bb9a18458741a85;hb=ff5b3f5a76fb744b332bc5d0fb3ef5632ce02879;hpb=73f8e125d9910c93213d357c2779cc743fa22e8b diff --git a/code/_reduction_with_environments.ml b/code/reduction_with_closures.ml similarity index 98% rename from code/_reduction_with_environments.ml rename to code/reduction_with_closures.ml index db406c75..dc3d8fa2 100644 --- a/code/_reduction_with_environments.ml +++ b/code/reduction_with_closures.ml @@ -58,7 +58,7 @@ let rec eval (term:lambdaTerm) (r:env) : value = | value -> eval body (push bound_ident value r)) | App(head, arg) -> (match eval head r with | LiteralV lit -> raise (Stuck (App(Constant(LiteralC lit), arg))) - | Closure (Abstract(bound_ident, body), saved_r) -> let argval = eval arg r in eval body (push bound_ident argval saved_r) + | Closure (Abstract(bound_ident, body), saved_r) -> eval body (push bound_ident arg saved_r) (* FIX ME *) | Closure (Constant (FunctC Leq), saved_r) -> failwith "not yet implemented" | Closure (Constant (FunctC (_ as prim)), saved_r) -> (match (prim, eval arg r) with