From c5edf4854f07fb14003ac822b243ea35eab17d69 Mon Sep 17 00:00:00 2001 From: hellerve Date: Mon, 22 May 2017 18:58:42 -0400 Subject: [PATCH] eval: fixed first state forgetfulness issue (the prior commit didnt really fix it) --- src/BC/Eval.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BC/Eval.hs b/src/BC/Eval.hs index 1d82092..f79c843 100644 --- a/src/BC/Eval.hs +++ b/src/BC/Eval.hs @@ -137,10 +137,10 @@ funCall state (BFun name args body) provided = in callWith (M.insert a evald nstate) args provided funCall state (BNative body) provided = let (args, nstate) = callWith state provided - in (body args, state) + in (body args, nstate) -- TODO: make tail recursive with accumulator - where callWith state [] = (state, []) + where callWith state [] = ([], state) callWith state (x:xs) = let (evald, nstate) = eval state x - (retstate, l) = callWith nstate xs - in (retstate, evald:l) + (l, retstate) = callWith nstate xs + in (evald:l, retstate)