From 5b0fdead90d27430ead2378c7ba37e788a4696b7 Mon Sep 17 00:00:00 2001 From: crumbtoo Date: Thu, 30 Nov 2023 11:14:52 -0700 Subject: [PATCH] fix NNum sharing not updating env when will i learn to confirm results before pushing... --- src/GM.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GM.hs b/src/GM.hs index 1b8d3a5..de53d83 100644 --- a/src/GM.hs +++ b/src/GM.hs @@ -144,6 +144,7 @@ step st = case head (st ^. gmCode) of & gmCode %~ drop 1 & gmStack .~ s' & gmHeap .~ h' + & gmEnv .~ m' -- record the newly allocated int & gmStats . stsAllocations %~ succ -- where @@ -167,8 +168,8 @@ step st = case head (st ^. gmCode) of -- s = st ^. gmStack -- h = st ^. gmHeap - -- s' = a : s - -- (h',a) = alloc h (NNum n) + s' = a : s + (h',a) = alloc h (NNum n) mkAp :: GmState -> GmState mkAp st = st