Commit 041bd10d authored by POTTIER Francois's avatar POTTIER Francois

Improve [CodeBits.blet] so as to simplify [let x = e in x].

This makes no difference on the test suite.
parent d723cc3b
......@@ -130,10 +130,14 @@ let rec simplify = function
(* Building a [let] construct, with on-the-fly simplification. *)
let blet (bindings, body) =
match simplify bindings with
| [] ->
let bindings = simplify bindings in
match bindings, body with
| [], _ ->
body
| bindings ->
| [ PVar x1, e ], EVar x2 when x1 = x2 ->
(* Reduce [let x = e in x] to just [e]. *)
e
| _, _ ->
ELet (bindings, body)
let mlet formals actuals body =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment