From 19426d94da3c025a230a826bb7a4d33e1fe781e7 Mon Sep 17 00:00:00 2001 From: yhs0602 Date: Sat, 1 Jun 2024 20:18:52 +0900 Subject: [PATCH] :recycle: Ocaml --- lib/compile.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compile.ml b/lib/compile.ml index eaf168f..658e97c 100644 --- a/lib/compile.ml +++ b/lib/compile.ml @@ -162,10 +162,10 @@ let rec compile (env : Env.t) (pred : Pred.t) (exp : Exp.t) : let g', de = compile env pred e in (g @+ g', de)) in - let body = f.body in - let param_det_pairs = List.zip_exn f.params det_exps in + let { params; body; _ } = f in + let param_det_pairs = List.zip_exn params det_exps in let sub_body = - List.fold_left param_det_pairs ~init:body + List.fold param_det_pairs ~init:body ~f:(fun acc (param_name, det_exp) -> sub acc param_name det_exp) in let g_body, det_exp_body = compile env pred sub_body in