about summary refs log tree commit diff stats
path: root/chessboard.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-13 22:43:16 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-13 22:50:49 -0700
commit77d5b5d658830bd24724f945e0d6ddf6a06adc0e (patch)
tree94c50c0ddfa6d55dc1189d62243ceeacaf783326 /chessboard.mu
parent84e4ed1ab58d5b34cf92919aedbb15736a7349d9 (diff)
downloadmu-77d5b5d658830bd24724f945e0d6ddf6a06adc0e.tar.gz
1780 - now we always reclaim local scopes
But still no difference in either memory footprint or in running time.
This will teach me -- for the umpteenth time -- to optimize before
measuring.
Diffstat (limited to 'chessboard.mu')
-rw-r--r--chessboard.mu20
1 files changed, 10 insertions, 10 deletions
diff --git a/chessboard.mu b/chessboard.mu
index f5b298cb..a91e6da7 100644
--- a/chessboard.mu
+++ b/chessboard.mu
@@ -82,7 +82,7 @@ scenario print-board-and-read-move [
 recipe chessboard [
 #?   $start-tracing [schedule] #? 2
 #?   $start-tracing #? 1
-  new-default-space
+  local-scope
   screen:address <- next-ingredient
   console:address <- next-ingredient
 #?   $print [screen: ], screen:address, [, console: ], console:address, [ 
@@ -138,7 +138,7 @@ recipe chessboard [
 ## a board is an array of files, a file is an array of characters (squares)
 
 recipe new-board [
-  new-default-space
+  local-scope
   initial-position:address:array:number <- next-ingredient
   # assert(length(initial-position) == 64)
   len:number <- length initial-position:address:array:number/deref
@@ -159,7 +159,7 @@ recipe new-board [
 ]
 
 recipe new-file [
-  new-default-space
+  local-scope
   position:address:array:number <- next-ingredient
   index:number <- next-ingredient
   index:number <- multiply index:number, 8:literal
@@ -178,7 +178,7 @@ recipe new-file [
 ]
 
 recipe print-board [
-  new-default-space
+  local-scope
   screen:address <- next-ingredient
   board:address:array:address:array:character <- next-ingredient
   row:number <- copy 7:literal  # start printing from the top of the board
@@ -227,7 +227,7 @@ recipe print-board [
 
 # board:address:array:address:array:character <- initial-position
 recipe initial-position [
-  new-default-space
+  local-scope
   # layout in memory (in raster order):
   #   R P _ _ _ _ p r
   #   N P _ _ _ _ p n
@@ -287,7 +287,7 @@ container move [
 # result:address:move, quit?:boolean, error?:boolean <- read-move stdin:address:channel, screen:address
 # prints only error messages to screen
 recipe read-move [
-  new-default-space
+  local-scope
   stdin:address:channel <- next-ingredient
   screen:address <- next-ingredient
 #?   $print screen:address #? 1
@@ -322,7 +322,7 @@ recipe read-move [
 # file:number, quit:boolean, error:boolean <- read-file stdin:address:channel, screen:address
 # valid values for file: 0-7
 recipe read-file [
-  new-default-space
+  local-scope
   stdin:address:channel <- next-ingredient
   screen:address <- next-ingredient
   c:character, stdin:address:channel <- read stdin:address:channel
@@ -375,7 +375,7 @@ recipe read-file [
 # rank:number <- read-rank stdin:address:channel, screen:address
 # valid values: 0-7, -1 (quit), -2 (error)
 recipe read-rank [
-  new-default-space
+  local-scope
   stdin:address:channel <- next-ingredient
   screen:address <- next-ingredient
   c:character, stdin:address:channel <- read stdin:address:channel
@@ -422,7 +422,7 @@ recipe read-rank [
 # read a character from the given channel and check that it's what we expect
 # return true on error
 recipe expect-from-channel [
-  new-default-space
+  local-scope
   stdin:address:channel <- next-ingredient
   expected:character <- next-ingredient
   screen:address <- next-ingredient
@@ -624,7 +624,7 @@ F read-move-file: routine failed to pause after coming up (before any keys were
 ]
 
 recipe make-move [
-  new-default-space
+  local-scope
   b:address:array:address:array:character <- next-ingredient
   m:address:move <- next-ingredient
   from-file:number <- get m:address:move/deref, from-file:offset