about summary refs log tree commit diff stats
path: root/edit.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-13 20:33:39 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-13 20:33:39 -0700
commitdfd2ed38f24b82da102d7fd899fa58bb0a791023 (patch)
tree37f72197f8239e6bb79ad2fed9ae3e606b875fd9 /edit.mu
parenta2d8c7132258efeb6da2716267786a931f95b47b (diff)
downloadmu-dfd2ed38f24b82da102d7fd899fa58bb0a791023.tar.gz
1773 - update all mu recipes to new-default-space
Turns out to not affect memory utilization or run-time. At all.
But still looks nicer and requires less fudging on our part.
Diffstat (limited to 'edit.mu')
-rw-r--r--edit.mu52
1 files changed, 26 insertions, 26 deletions
diff --git a/edit.mu b/edit.mu
index 787d5723..fef432cb 100644
--- a/edit.mu
+++ b/edit.mu
@@ -1,7 +1,7 @@
 # Environment for learning programming using mu.
 
 recipe main [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   open-console
   initial-recipe:address:array:character <- new [recipe new-add [
   x:number <- next-ingredient
@@ -24,7 +24,7 @@ container programming-environment-data [
 ]
 
 recipe new-programming-environment [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   initial-recipe-contents:address:array:character <- next-ingredient
   initial-sandbox-contents:address:array:character <- next-ingredient
@@ -91,7 +91,7 @@ container editor-data [
 #   top/left/right constrain the screen area available to the new editor.
 #   right is exclusive.
 recipe new-editor [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   s:address:array:character <- next-ingredient
   screen:address <- next-ingredient
   # no clipping of bounds
@@ -161,7 +161,7 @@ scenario editor-initializes-without-data [
 
 # bottom:number, screen:address <- render screen:address, editor:address:editor-data
 recipe render [
-  default-space:address:array:location <- new location:type, 40:literal
+  new-default-space
   screen:address <- next-ingredient
   editor:address:editor-data <- next-ingredient
   reply-unless editor:address:editor-data, 1:literal/top, screen:address/same-as-ingredient:0
@@ -268,7 +268,7 @@ recipe render [
 # print a string 's' to 'editor' in 'color' starting at 'row'
 # leave cursor at start of next line
 recipe render-string [
-  default-space:address:array:location <- new location:type, 40:literal
+  new-default-space
   screen:address <- next-ingredient
   s:address:array:character <- next-ingredient
   left:number <- next-ingredient
@@ -334,7 +334,7 @@ recipe render-string [
 ]
 
 recipe clear-line-delimited [
-  default-space:address:array:location <- new location:type, 40:literal
+  new-default-space
   screen:address <- next-ingredient
   left:number <- next-ingredient
   right:number <- next-ingredient
@@ -455,7 +455,7 @@ scenario editor-initializes-empty-text [
 ## handling events from the keyboard, mouse, touch screen, ...
 
 recipe event-loop [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   console:address <- next-ingredient
   env:address:programming-environment-data <- next-ingredient
@@ -514,7 +514,7 @@ recipe event-loop [
 
 # helper for testing a single editor
 recipe editor-event-loop [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   console:address <- next-ingredient
   editor:address:editor-data <- next-ingredient
@@ -547,7 +547,7 @@ recipe editor-event-loop [
 ]
 
 recipe handle-event [
-  default-space:address:array:location <- new location:type, 50:literal
+  new-default-space
   screen:address <- next-ingredient
   console:address <- next-ingredient
   editor:address:editor-data <- next-ingredient
@@ -686,7 +686,7 @@ recipe handle-event [
 # process click, return if it was on current editor
 # todo: ignores menu bar (for now just displays shortcuts)
 recipe move-cursor-in-editor [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   editor:address:editor-data <- next-ingredient
   t:touch-event <- next-ingredient
@@ -709,7 +709,7 @@ recipe move-cursor-in-editor [
 ]
 
 recipe insert-at-cursor [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   editor:address:editor-data <- next-ingredient
   c:character <- next-ingredient
   screen:address <- next-ingredient
@@ -757,7 +757,7 @@ recipe insert-at-cursor [
 ]
 
 recipe delete-before-cursor [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   editor:address:editor-data <- next-ingredient
   before-cursor:address:address:duplex-list <- get-address editor:address:editor-data/deref, before-cursor:offset
   d:address:duplex-list <- get editor:address:editor-data/deref, data:offset
@@ -778,7 +778,7 @@ recipe delete-before-cursor [
 # takes a pointer 'curr' into the doubly-linked list and its sentinel, counts
 # the length of the previous line before the 'curr' pointer.
 recipe previous-line-length [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   curr:address:duplex-list <- next-ingredient
   start:address:duplex-list <- next-ingredient
   result:number <- copy 0:literal
@@ -800,7 +800,7 @@ recipe previous-line-length [
 ]
 
 recipe render-all [
-  default-space:address:array:location <- new location:type, 40:literal
+  new-default-space
   screen:address <- next-ingredient
   env:address:programming-environment-data <- next-ingredient
   recipes:address:editor-data <- get env:address:programming-environment-data/deref, recipes:offset
@@ -844,7 +844,7 @@ recipe render-all [
 ]
 
 recipe render-sandboxes [
-  default-space:address:array:location <- new location:type, 40:literal
+  new-default-space
   screen:address <- next-ingredient
   sandbox:address:sandbox-data <- next-ingredient
   left:number <- next-ingredient
@@ -877,7 +877,7 @@ recipe render-sandboxes [
 ]
 
 recipe update-cursor [
-  default-space:address:array:location <- new location:type, 40:literal
+  new-default-space
   screen:address <- next-ingredient
   recipes:address:editor-data <- next-ingredient
   current-sandbox:address:editor-data <- next-ingredient
@@ -1941,7 +1941,7 @@ scenario run-and-show-results [
 ]
 
 recipe run-sandboxes [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   env:address:programming-environment-data <- next-ingredient
   recipes:address:editor-data <- get env:address:programming-environment-data/deref, recipes:offset
   current-sandbox:address:editor-data <- get env:address:programming-environment-data/deref, current-sandbox:offset
@@ -2084,7 +2084,7 @@ scenario run-instruction-and-print-warnings [
 ]
 
 recipe editor-contents [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   editor:address:editor-data <- next-ingredient
   buf:address:buffer <- new-buffer 80:literal
   curr:address:duplex-list <- get editor:address:editor-data/deref, data:offset
@@ -2124,7 +2124,7 @@ scenario editor-provides-edited-contents [
 ## helpers for drawing editor borders
 
 recipe draw-box [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   top:number <- next-ingredient
   left:number <- next-ingredient
@@ -2152,7 +2152,7 @@ recipe draw-box [
 ]
 
 recipe draw-horizontal [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   row:number <- next-ingredient
   x:number <- next-ingredient
@@ -2184,7 +2184,7 @@ recipe draw-horizontal [
 ]
 
 recipe draw-vertical [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   col:number <- next-ingredient
   x:number <- next-ingredient
@@ -2211,7 +2211,7 @@ recipe draw-vertical [
 ]
 
 recipe draw-top-left [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   top:number <- next-ingredient
   left:number <- next-ingredient
@@ -2226,7 +2226,7 @@ recipe draw-top-left [
 ]
 
 recipe draw-top-right [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   top:number <- next-ingredient
   right:number <- next-ingredient
@@ -2241,7 +2241,7 @@ recipe draw-top-right [
 ]
 
 recipe draw-bottom-left [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   bottom:number <- next-ingredient
   left:number <- next-ingredient
@@ -2256,7 +2256,7 @@ recipe draw-bottom-left [
 ]
 
 recipe draw-bottom-right [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   screen:address <- next-ingredient
   bottom:number <- next-ingredient
   right:number <- next-ingredient
@@ -2271,7 +2271,7 @@ recipe draw-bottom-right [
 ]
 
 recipe print-string-with-gradient-background [
-  default-space:address:array:location <- new location:type, 30:literal
+  new-default-space
   x:address:screen <- next-ingredient
   s:address:array:character <- next-ingredient
   color:number <- next-ingredient