Executable Semantics: 1st-class stacks (#296)

Replaces low-level uses of `Cons` with a first-class `Stack` data structure.  Also removes an unused algorithm.
Co-authored-by: Jeremy Siek <jsiek@indiana.edu>

Possible next step: use `std::stack` instead.
This commit is contained in:
Dave Abrahams
2021-02-26 09:46:32 -08:00
committed by GitHub
parent 21917095a3
commit 29a59944fa
11 changed files with 352 additions and 204 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ env: t: 5, main: fun<main>,
--- handle value 0 with return 0;<1>(0,) --->
{
stack: top{0<-1>}
heap: fun<main>, 5,
heap: fun<main>, !!5,
env: main: fun<main>,
}
result: 0
+1 -1
View File
@@ -211,7 +211,7 @@ env: _: 5, t: 5, main: fun<main>,
--- handle value 0 with return 0;<1>(0,) --->
{
stack: top{0<-1>}
heap: fun<main>, 5, !!5,
heap: fun<main>, !!5, !!5,
env: main: fun<main>,
}
result: 0
+1 -1
View File
@@ -312,7 +312,7 @@ env: b: 2, a: 5, t: (0 = 5@3, 1 = 2@4), main: fun<main>,
--- handle value 0 with return ((a + b) - 7);<1>(0,) --->
{
stack: top{0<-1>}
heap: fun<main>, 5, 2, 5, 2, (0 = 5@3, 1 = 2@4), auto: a, auto: b, !!5, !!2,
heap: fun<main>, 5, 2, !!5, !!2, !!(0 = !!5@3, 1 = !!2@4), auto: a, auto: b, !!5, !!2,
env: main: fun<main>,
}
result: 0