about summary refs log tree commit diff stats
path: root/074list.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-05-26 16:46:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-05-26 16:46:38 -0700
commitad8161f34526599a94b12d38554cff9ac20467da (patch)
tree88261c5018d8582aa281889852f268a31f87c5fb /074list.mu
parentf88551d1bdc28afaa1c60c97205d152417e6f145 (diff)
downloadmu-ad8161f34526599a94b12d38554cff9ac20467da.tar.gz
3015 - more symbolic names in tests
There's still a problem: if I ever want to use any of the special
scenario variables like 'screen', 'console', etc., then I can't use
'local-scope' in my scenario.
Diffstat (limited to '074list.mu')
-rw-r--r--074list.mu27
1 files changed, 14 insertions, 13 deletions
diff --git a/074list.mu b/074list.mu
index 79fed038..80613694 100644
--- a/074list.mu
+++ b/074list.mu
@@ -29,21 +29,22 @@ def rest in:address:list:_elem -> result:address:list:_elem/contained-in:in [
 
 scenario list-handling [
   run [
-    1:address:list:number <- push 3, 0
-    1:address:list:number <- push 4, 1:address:list:number
-    1:address:list:number <- push 5, 1:address:list:number
-    2:number <- first 1:address:list:number
-    1:address:list:number <- rest 1:address:list:number
-    3:number <- first 1:address:list:number
-    1:address:list:number <- rest 1:address:list:number
-    4:number <- first 1:address:list:number
-    1:address:list:number <- rest 1:address:list:number
+    local-scope
+    x:address:list:number <- push 3, 0
+    x <- push 4, x
+    x <- push 5, x
+    10:number/raw <- first x
+    x <- rest x
+    11:number/raw <- first x
+    x <- rest x
+    12:number/raw <- first x
+    20:address:list:number/raw <- rest x
   ]
   memory-should-contain [
-    1 <- 0  # empty to empty, dust to dust..
-    2 <- 5
-    3 <- 4
-    4 <- 3
+    10 <- 5
+    11 <- 4
+    12 <- 3
+    20 <- 0  # nothing left
   ]
 ]