From f344b250f6f062a1a1902bf69b23ebf9b565de0e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 17 Sep 2016 15:01:51 -0700 Subject: 3395 --- html/045closure_name.cc.html | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'html/045closure_name.cc.html') diff --git a/html/045closure_name.cc.html b/html/045closure_name.cc.html index 9cc50979..c4f9a0ef 100644 --- a/html/045closure_name.cc.html +++ b/html/045closure_name.cc.html @@ -40,23 +40,23 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(scenario closure) def main [ - default-space:address:array:location <- new location:type, 30 - 1:address:array:location/names:new-counter <- new-counter - 2:number/raw <- increment-counter 1:address:array:location/names:new-counter - 3:number/raw <- increment-counter 1:address:array:location/names:new-counter + default-space:space <- new location:type, 30 + 1:space/names:new-counter <- new-counter + 2:num/raw <- increment-counter 1:space/names:new-counter + 3:num/raw <- increment-counter 1:space/names:new-counter ] def new-counter [ - default-space:address:array:location <- new location:type, 30 - x:number <- copy 23 - y:number <- copy 3 # variable that will be incremented - return default-space:address:array:location + default-space:space <- new location:type, 30 + x:num <- copy 23 + y:num <- copy 3 # variable that will be incremented + return default-space:space ] def increment-counter [ - default-space:address:array:location <- new location:type, 30 - 0:address:array:location/names:new-counter <- next-ingredient # outer space must be created by 'new-counter' above - y:number/space:1 <- add y:number/space:1, 1 # increment - y:number <- copy 234 # dummy - return y:number/space:1 + default-space:space <- new location:type, 30 + 0:space/names:new-counter <- next-ingredient # outer space must be created by 'new-counter' above + y:num/space:1 <- add y:num/space:1, 1 # increment + y:num <- copy 234 # dummy + return y:num/space:1 ] +name: lexically surrounding space for recipe increment-counter comes from new-counter +mem: storing 5 in location 3 @@ -177,7 +177,7 @@ recipe_ordinal lookup_surrounding_recipe(% Hide_errors = true; def f [ local-scope - x:number/space:1 <- copy 34 + x:num/space:1 <- copy 34 ] +error: don't know surrounding recipe of 'f' +error: f: can't find a place to store 'x' @@ -186,19 +186,19 @@ def f [ :(scenario local_scope_ignores_nonlocal_spaces) def new-scope [ new-default-space - x:address:number <- new number:type - *x:address:number <- copy 34 - return default-space:address:array:location + x:&:num <- new number:type + *x:&:num <- copy 34 + return default-space:space ] def use-scope [ local-scope - outer:address:array:location <- next-ingredient - 0:address:array:location/names:new-scope <- copy outer:address:array:location - return *x:address:number/space:1 + outer:space <- next-ingredient + 0:space/names:new-scope <- copy outer:space + return *x:&:num/space:1 ] def main [ - 1:address:array:location/raw <- new-scope - 2:number/raw <- use-scope 1:address:array:location/raw + 1:space/raw <- new-scope + 2:num/raw <- use-scope 1:space/raw ] +mem: storing 34 in location 2 -- cgit 1.4.1-2-gfad0