From ad8161f34526599a94b12d38554cff9ac20467da Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 26 May 2016 16:46:38 -0700 Subject: 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. --- 074list.mu | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to '074list.mu') 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 ] ] -- cgit 1.4.1-2-gfad0