about summary refs log tree commit diff stats
path: root/edit
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-28 19:48:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-28 19:48:56 -0700
commit6f65d5918f4b73de56e6cb6362c7cbc7dbbe5945 (patch)
treedec4043f2d62f5dd02156d369e20af247881e2ac /edit
parent1627d836b46440f57d766b154ec488fa2e5a1e06 (diff)
downloadmu-6f65d5918f4b73de56e6cb6362c7cbc7dbbe5945.tar.gz
3429 - standardize Mu scenarios
A long-standing problem has been that I couldn't spread code across
'run' blocks because they were separate scopes, so I've ended up making
them effectively comments. Running code inside a 'run' block is
identical in every way to simply running the code directly. The 'run'
block is merely a visual aid to separate setup from the component under
test.

In the process I've also standardized all Mu scenarios to always run in
a local scope, and only use (raw) numeric addresses for values they want
to check later.
Diffstat (limited to 'edit')
-rw-r--r--edit/001-editor.mu38
-rw-r--r--edit/002-typing.mu236
-rw-r--r--edit/003-shortcuts.mu748
-rw-r--r--edit/004-programming-environment.mu78
-rw-r--r--edit/005-sandbox.mu129
-rw-r--r--edit/006-sandbox-copy.mu36
-rw-r--r--edit/007-sandbox-delete.mu55
-rw-r--r--edit/008-sandbox-edit.mu57
-rw-r--r--edit/009-sandbox-test.mu16
-rw-r--r--edit/010-sandbox-trace.mu37
-rw-r--r--edit/011-errors.mu130
-rw-r--r--edit/012-editor-undo.mu574
12 files changed, 1100 insertions, 1034 deletions
diff --git a/edit/001-editor.mu b/edit/001-editor.mu
index 0b5aaa4a..bbe16390 100644
--- a/edit/001-editor.mu
+++ b/edit/001-editor.mu
@@ -14,10 +14,10 @@ def! main text:text [
 ]
 
 scenario editor-initially-prints-text-to-screen [
+  local-scope
   assume-screen 10/width, 5/height
   run [
-    1:text <- new [abc]
-    new-editor 1:text, screen:&:screen, 0/left, 10/right
+    new-editor [abc], screen:&:screen, 0/left, 10/right
   ]
   screen-should-contain [
     # top line of screen reserved for menu
@@ -95,10 +95,11 @@ def insert-text editor:&:editor, text:text -> editor:&:editor [
 ]
 
 scenario editor-initializes-without-data [
+  local-scope
   assume-screen 5/width, 3/height
   run [
-    1:&:editor <- new-editor 0/data, screen:&:screen, 2/left, 5/right
-    2:editor <- copy *1:&:editor
+    e:&:editor <- new-editor 0/data, screen:&:screen, 2/left, 5/right
+    2:editor/raw <- copy *e
   ]
   memory-should-contain [
     # 2 (data) <- just the § sentinel
@@ -255,11 +256,12 @@ def clear-rest-of-screen screen:&:screen, row:num, left:num, right:num -> screen
 ]
 
 scenario editor-initially-prints-multiple-lines [
+  local-scope
   assume-screen 5/width, 5/height
   run [
     s:text <- new [abc
 def]
-    new-editor s:text, screen:&:screen, 0/left, 5/right
+    new-editor s, screen:&:screen, 0/left, 5/right
   ]
   screen-should-contain [
     .     .
@@ -270,10 +272,11 @@ def]
 ]
 
 scenario editor-initially-handles-offsets [
+  local-scope
   assume-screen 5/width, 5/height
   run [
     s:text <- new [abc]
-    new-editor s:text, screen:&:screen, 1/left, 5/right
+    new-editor s, screen:&:screen, 1/left, 5/right
   ]
   screen-should-contain [
     .     .
@@ -283,11 +286,12 @@ scenario editor-initially-handles-offsets [
 ]
 
 scenario editor-initially-prints-multiple-lines-at-offset [
+  local-scope
   assume-screen 5/width, 5/height
   run [
     s:text <- new [abc
 def]
-    new-editor s:text, screen:&:screen, 1/left, 5/right
+    new-editor s, screen:&:screen, 1/left, 5/right
   ]
   screen-should-contain [
     .     .
@@ -298,10 +302,11 @@ def]
 ]
 
 scenario editor-initially-wraps-long-lines [
+  local-scope
   assume-screen 5/width, 5/height
   run [
     s:text <- new [abc def]
-    new-editor s:text, screen:&:screen, 0/left, 5/right
+    new-editor s, screen:&:screen, 0/left, 5/right
   ]
   screen-should-contain [
     .     .
@@ -318,10 +323,11 @@ scenario editor-initially-wraps-long-lines [
 ]
 
 scenario editor-initially-wraps-barely-long-lines [
+  local-scope
   assume-screen 5/width, 5/height
   run [
     s:text <- new [abcde]
-    new-editor s:text, screen:&:screen, 0/left, 5/right
+    new-editor s, screen:&:screen, 0/left, 5/right
   ]
   # still wrap, even though the line would fit. We need room to click on the
   # end of the line
@@ -340,12 +346,12 @@ scenario editor-initially-wraps-barely-long-lines [
 ]
 
 scenario editor-initializes-empty-text [
+  local-scope
   assume-screen 5/width, 5/height
   run [
-    1:text <- new []
-    2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    e:&:editor <- new-editor [], screen:&:screen, 0/left, 5/right
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .     .
@@ -361,12 +367,13 @@ scenario editor-initializes-empty-text [
 # just a little color for mu code
 
 scenario render-colors-comments [
+  local-scope
   assume-screen 5/width, 5/height
   run [
     s:text <- new [abc
 # de
 f]
-    new-editor s:text, screen:&:screen, 0/left, 5/right
+    new-editor s, screen:&:screen, 0/left, 5/right
   ]
   screen-should-contain [
     .     .
@@ -442,12 +449,13 @@ def get-color color:num, c:char -> color:num [
 ]
 
 scenario render-colors-assignment [
+  local-scope
   assume-screen 8/width, 5/height
   run [
     s:text <- new [abc
 d <- e
 f]
-    new-editor s:text, screen:&:screen, 0/left, 8/right
+    new-editor s, screen:&:screen, 0/left, 8/right
   ]
   screen-should-contain [
     .        .
diff --git a/edit/002-typing.mu b/edit/002-typing.mu
index 68af65ee..07466d38 100644
--- a/edit/002-typing.mu
+++ b/edit/002-typing.mu
@@ -281,13 +281,13 @@ def editor-render screen:&:screen, editor:&:editor -> screen:&:screen, editor:&:
 ]
 
 scenario editor-handles-empty-event-queue [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console []
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -298,18 +298,18 @@ scenario editor-handles-empty-event-queue [
 ]
 
 scenario editor-handles-mouse-clicks [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 1  # on the 'b'
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -325,17 +325,17 @@ scenario editor-handles-mouse-clicks [
 ]
 
 scenario editor-handles-mouse-clicks-outside-text [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
   $clear-trace
   assume-console [
     left-click 1, 7  # last line, to the right of text
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1  # cursor row
@@ -345,18 +345,19 @@ scenario editor-handles-mouse-clicks-outside-text [
 ]
 
 scenario editor-handles-mouse-clicks-outside-text-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   $clear-trace
   assume-console [
     left-click 1, 7  # interior line, to the right of text
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1  # cursor row
@@ -366,18 +367,19 @@ def]
 ]
 
 scenario editor-handles-mouse-clicks-outside-text-3 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   $clear-trace
   assume-console [
     left-click 3, 7  # below text
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 2  # cursor row
@@ -387,20 +389,20 @@ def]
 ]
 
 scenario editor-handles-mouse-clicks-outside-column [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
   # editor occupies only left half of screen
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     # click on right half of screen
     left-click 3, 8
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -416,19 +418,19 @@ scenario editor-handles-mouse-clicks-outside-column [
 ]
 
 scenario editor-handles-mouse-clicks-in-menu-area [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     # click on first, 'menu' row
     left-click 0, 3
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # no change to cursor
   memory-should-contain [
@@ -438,16 +440,16 @@ scenario editor-handles-mouse-clicks-in-menu-area [
 ]
 
 scenario editor-inserts-characters-into-empty-editor [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     type [abc]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -459,10 +461,10 @@ scenario editor-inserts-characters-into-empty-editor [
 ]
 
 scenario editor-inserts-characters-at-cursor [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # type two letters at different places
   assume-console [
@@ -471,7 +473,7 @@ scenario editor-inserts-characters-at-cursor [
     type [d]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -483,17 +485,17 @@ scenario editor-inserts-characters-at-cursor [
 ]
 
 scenario editor-inserts-characters-at-cursor-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 5  # right of last line
     type [d]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -505,18 +507,19 @@ scenario editor-inserts-characters-at-cursor-2 [
 ]
 
 scenario editor-inserts-characters-at-cursor-5 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 5  # right of non-last line
     type [e]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -529,17 +532,17 @@ d]
 ]
 
 scenario editor-inserts-characters-at-cursor-3 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 3, 5  # below all text
     type [d]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -551,18 +554,19 @@ scenario editor-inserts-characters-at-cursor-3 [
 ]
 
 scenario editor-inserts-characters-at-cursor-4 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 3, 5  # below all text
     type [e]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -575,18 +579,19 @@ d]
 ]
 
 scenario editor-inserts-characters-at-cursor-6 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 3, 5  # below all text
     type [ef]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -599,15 +604,15 @@ d]
 ]
 
 scenario editor-moves-cursor-after-inserting-characters [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [ab]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [ab], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   assume-console [
     type [01]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -620,16 +625,16 @@ scenario editor-moves-cursor-after-inserting-characters [
 # if the cursor reaches the right margin, wrap the line
 
 scenario editor-wraps-line-on-insert [
+  local-scope
   assume-screen 5/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   # type a letter
   assume-console [
     type [e]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # no wrap yet
   screen-should-contain [
@@ -644,7 +649,7 @@ scenario editor-wraps-line-on-insert [
     type [f]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # now wrap
   screen-should-contain [
@@ -657,21 +662,22 @@ scenario editor-wraps-line-on-insert [
 ]
 
 scenario editor-wraps-line-on-insert-2 [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abcdefg
+  s:text <- new [abcdefg
 defg]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   # type more text at the start
   assume-console [
     left-click 3, 0
     type [abc]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor is not wrapped
   memory-should-contain [
@@ -740,17 +746,17 @@ after <insert-character-special-case> [
 ]
 
 scenario editor-wraps-cursor-after-inserting-characters-in-middle-of-line [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abcde]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right
   assume-console [
     left-click 1, 3  # right before the wrap icon
     type [f]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -769,9 +775,9 @@ scenario editor-wraps-cursor-after-inserting-characters-at-end-of-line [
   local-scope
   assume-screen 10/width, 5/height
   # create an editor containing two lines
-  contents:text <- new [abc
+  s:text <- new [abc
 xyz]
-  1:&:editor/raw <- new-editor contents, screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen, 0/left, 5/right
   screen-should-contain [
     .          .
     .abc       .
@@ -783,7 +789,7 @@ xyz]
     type [de]  # trigger wrap
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 1:&:editor/raw
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -795,17 +801,17 @@ xyz]
 ]
 
 scenario editor-wraps-cursor-to-left-margin [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abcde]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 2/left, 7/right
+  e:&:editor <- new-editor [abcde], screen:&:screen, 2/left, 7/right
   assume-console [
     left-click 1, 5  # line is full; no wrap icon yet
     type [01]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -831,15 +837,15 @@ after <editor-initialization> [
 ]
 
 scenario editor-moves-cursor-down-after-inserting-newline [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
   assume-console [
     type [0
 1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -855,14 +861,14 @@ after <handle-special-character> [
     newline?:bool <- equal c, 10/newline
     break-unless newline?
     <insert-enter-begin>
-    editor <- insert-newline-and-indent editor, screen
+    editor <- insert-new-line-and-indent editor, screen
     <insert-enter-end>
     go-render? <- copy 1/true
     return
   }
 ]
 
-def insert-newline-and-indent editor:&:editor, screen:&:screen -> editor:&:editor, screen:&:screen, go-render?:bool [
+def insert-new-line-and-indent editor:&:editor, screen:&:screen -> editor:&:editor, screen:&:screen, go-render?:bool [
   local-scope
   load-ingredients
   cursor-row:num <- get *editor, cursor-row:offset
@@ -937,15 +943,15 @@ def line-indent curr:&:duplex-list:char, start:&:duplex-list:char -> result:num
 ]
 
 scenario editor-moves-cursor-down-after-inserting-newline-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 1/left, 10/right
+  e:&:editor <- new-editor [abc], screen:&:screen, 1/left, 10/right
   assume-console [
     type [0
 1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -957,9 +963,9 @@ scenario editor-moves-cursor-down-after-inserting-newline-2 [
 ]
 
 scenario editor-clears-previous-line-completely-after-inserting-newline [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abcde]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right
   assume-console [
     press enter
   ]
@@ -971,7 +977,7 @@ scenario editor-clears-previous-line-completely-after-inserting-newline [
     .          .
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # line should be fully cleared
   screen-should-contain [
@@ -984,11 +990,12 @@ scenario editor-clears-previous-line-completely-after-inserting-newline [
 ]
 
 scenario editor-inserts-indent-after-newline [
+  local-scope
   assume-screen 10/width, 10/height
-  1:text <- new [ab
+  s:text <- new [ab
   cd
 ef]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # position cursor after 'cd' and hit 'newline'
   assume-console [
     left-click 2, 8
@@ -996,9 +1003,9 @@ ef]
 ]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor should be below start of previous line
   memory-should-contain [
@@ -1008,11 +1015,12 @@ ef]
 ]
 
 scenario editor-skips-indent-around-paste [
+  local-scope
   assume-screen 10/width, 10/height
-  1:text <- new [ab
+  s:text <- new [ab
   cd
 ef]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # position cursor after 'cd' and hit 'newline' surrounded by paste markers
   assume-console [
     left-click 2, 8
@@ -1021,9 +1029,9 @@ ef]
     press 65506  # end paste
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor should be below start of previous line
   memory-should-contain [
diff --git a/edit/003-shortcuts.mu b/edit/003-shortcuts.mu
index 70917808..2058aadd 100644
--- a/edit/003-shortcuts.mu
+++ b/edit/003-shortcuts.mu
@@ -5,16 +5,17 @@
 # tab - insert two spaces
 
 scenario editor-inserts-two-spaces-on-tab [
+  local-scope
   assume-screen 10/width, 5/height
   # just one character in final line
-  1:text <- new [ab
+  s:text <- new [ab
 cd]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   assume-console [
     press tab
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -39,19 +40,19 @@ after <handle-special-character> [
 # backspace - delete character before cursor
 
 scenario editor-handles-backspace-key [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 1
     press backspace
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -216,19 +217,20 @@ def previous-line-length curr:&:duplex-list:char, start:&:duplex-list:char -> re
 ]
 
 scenario editor-clears-last-line-on-backspace [
+  local-scope
   assume-screen 10/width, 5/height
   # just one character in final line
-  1:text <- new [ab
+  s:text <- new [ab
 cd]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   assume-console [
     left-click 2, 0  # cursor at only character in final line
     press backspace
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -243,12 +245,13 @@ cd]
 ]
 
 scenario editor-joins-and-wraps-lines-on-backspace [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with two long-ish but non-wrapping lines
-  1:text <- new [abc def
+  s:text <- new [abc def
 ghi jkl]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # position the cursor at the start of the second and hit backspace
   assume-console [
@@ -256,7 +259,7 @@ ghi jkl]
     press backspace
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # resulting single line should wrap correctly
   screen-should-contain [
@@ -269,11 +272,11 @@ ghi jkl]
 ]
 
 scenario editor-wraps-long-lines-on-backspace [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor in part of the screen with a long line
-  1:text <- new [abc def ghij]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 8/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc def ghij], screen:&:screen, 0/left, 8/right
+  editor-render screen, e
   # confirm that it wraps
   screen-should-contain [
     .          .
@@ -288,7 +291,7 @@ scenario editor-wraps-long-lines-on-backspace [
     press backspace
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # resulting single line should wrap correctly and not overflow its bounds
   screen-should-contain [
@@ -303,16 +306,16 @@ scenario editor-wraps-long-lines-on-backspace [
 # delete - delete character at cursor
 
 scenario editor-handles-delete-key [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     press delete
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -326,7 +329,7 @@ scenario editor-handles-delete-key [
     press delete
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -392,17 +395,17 @@ def delete-at-cursor editor:&:editor, screen:&:screen -> editor:&:editor, screen
 # right arrow
 
 scenario editor-moves-cursor-right-with-key [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     press right-arrow
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -489,11 +492,12 @@ def move-cursor-coordinates-right editor:&:editor, screen-height:num -> editor:&
 ]
 
 scenario editor-moves-cursor-to-next-line-with-right-arrow [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # type right-arrow a few times to get to start of second line
   assume-console [
@@ -503,7 +507,7 @@ d]
     press right-arrow  # next line
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   check-trace-count-for-label 0, [print-character]
   # type something and ensure it goes where it should
@@ -511,7 +515,7 @@ d]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -524,11 +528,12 @@ d]
 ]
 
 scenario editor-moves-cursor-to-next-line-with-right-arrow-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 1/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 1/left, 10/right
+  editor-render screen, e
   assume-console [
     press right-arrow
     press right-arrow
@@ -537,7 +542,7 @@ d]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -549,19 +554,19 @@ d]
 ]
 
 scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abcdef]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abcdef], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 3
     press right-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -578,11 +583,11 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [
 ]
 
 scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [
+  local-scope
   assume-screen 10/width, 5/height
   # line just barely wrapping
-  1:text <- new [abcde]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abcde], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   # position cursor at last character before wrap and hit right-arrow
   assume-console [
@@ -590,9 +595,9 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [
     press right-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 2
@@ -603,9 +608,9 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [
     press right-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 2
@@ -615,19 +620,19 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [
 ]
 
 scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abcdef]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 1/left, 6/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abcdef], screen:&:screen, 1/left, 6/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 4
     press right-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   screen-should-contain [
     .          .
@@ -644,11 +649,12 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [
 ]
 
 scenario editor-moves-cursor-to-next-line-with-right-arrow-at-end-of-line [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # move to end of line, press right-arrow, type a character
   assume-console [
@@ -657,7 +663,7 @@ d]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # new character should be in next line
   screen-should-contain [
@@ -675,10 +681,10 @@ d]
 # left arrow
 
 scenario editor-moves-cursor-left-with-key [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 2
@@ -686,7 +692,7 @@ scenario editor-moves-cursor-left-with-key [
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -717,12 +723,13 @@ after <handle-special-key> [
 ]
 
 scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with two lines
-  1:text <- new [abc
+  s:text <- new [abc
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # position cursor at start of second line (so there's no previous newline)
   assume-console [
@@ -730,9 +737,9 @@ d]
     press left-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1
@@ -742,13 +749,14 @@ d]
 ]
 
 scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-2 [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with three lines
-  1:text <- new [abc
+  s:text <- new [abc
 def
 g]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s:text, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # position cursor further down (so there's a newline before the character at
   # the cursor)
@@ -758,7 +766,7 @@ g]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -771,12 +779,13 @@ g]
 ]
 
 scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-3 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 def
 g]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # position cursor at start of text, press left-arrow, then type a character
   assume-console [
@@ -785,7 +794,7 @@ g]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # left-arrow should have had no effect
   screen-should-contain [
@@ -799,13 +808,14 @@ g]
 ]
 
 scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-4 [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with text containing an empty line
-  1:text <- new [abc
+  s:text <- new [abc
 
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e:&:editor
   $clear-trace
   # position cursor right after empty line
   assume-console [
@@ -814,7 +824,7 @@ d]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -827,11 +837,11 @@ d]
 ]
 
 scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with a wrapping line
-  1:text <- new [abcdef]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [abcdef], screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   screen-should-contain [
     .          .
@@ -846,9 +856,9 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [
     press left-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1  # previous row
@@ -858,12 +868,13 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [
 ]
 
 scenario editor-moves-across-screen-lines-to-wrapping-line-with-left-arrow [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with a wrapping line followed by a second line
-  1:text <- new [abcdef
+  s:text <- new [abcdef
 g]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   screen-should-contain [
     .          .
@@ -878,9 +889,9 @@ g]
     press left-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 2  # previous row
@@ -890,12 +901,13 @@ g]
 ]
 
 scenario editor-moves-across-screen-lines-to-non-wrapping-line-with-left-arrow [
+  local-scope
   assume-screen 10/width, 5/height
   # initialize editor with a line on the verge of wrapping, followed by a second line
-  1:text <- new [abcd
+  s:text <- new [abcd
 e]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
+  editor-render screen, e
   $clear-trace
   screen-should-contain [
     .          .
@@ -910,9 +922,9 @@ e]
     press left-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1  # previous row
@@ -926,20 +938,21 @@ e]
 # up arrow
 
 scenario editor-moves-to-previous-line-with-up-arrow [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 2, 1
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1
@@ -950,7 +963,7 @@ def]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1042,20 +1055,21 @@ def move-to-previous-line editor:&:editor -> editor:&:editor, go-render?:bool [
 ]
 
 scenario editor-adjusts-column-at-previous-line [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [ab
+  s:text <- new [ab
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 2, 3
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1
@@ -1066,7 +1080,7 @@ def]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1078,20 +1092,21 @@ def]
 ]
 
 scenario editor-adjusts-column-at-empty-line [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [
+  s:text <- new [
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 2, 3
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 1
@@ -1102,7 +1117,7 @@ def]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1114,13 +1129,14 @@ def]
 ]
 
 scenario editor-moves-to-previous-line-from-left-margin [
+  local-scope
   assume-screen 10/width, 5/height
   # start out with three lines
-  1:text <- new [abc
+  s:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # click on the third line and hit up-arrow, so you end up just after a newline
   assume-console [
@@ -1128,9 +1144,9 @@ ghi]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 2
@@ -1141,7 +1157,7 @@ ghi]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1155,20 +1171,21 @@ ghi]
 # down arrow
 
 scenario editor-moves-to-next-line-with-down-arrow [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # cursor starts out at (1, 0)
   assume-console [
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # ..and ends at (2, 0)
   memory-should-contain [
@@ -1180,7 +1197,7 @@ def]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1260,20 +1277,21 @@ def move-to-next-line editor:&:editor, screen-height:num -> editor:&:editor, go-
 ]
 
 scenario editor-adjusts-column-at-next-line [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 de]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   assume-console [
     left-click 1, 3
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     3 <- 2
@@ -1284,7 +1302,7 @@ de]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1298,11 +1316,12 @@ de]
 # ctrl-a/home - move cursor to start of line
 
 scenario editor-moves-to-start-of-line-with-ctrl-a [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on second line, press ctrl-a
   assume-console [
@@ -1310,9 +1329,9 @@ scenario editor-moves-to-start-of-line-with-ctrl-a [
     press ctrl-a
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to start of line
   memory-should-contain [
@@ -1373,11 +1392,12 @@ def move-to-start-of-line editor:&:editor -> editor:&:editor [
 ]
 
 scenario editor-moves-to-start-of-line-with-ctrl-a-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on first line (no newline before), press ctrl-a
   assume-console [
@@ -1385,9 +1405,9 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [
     press ctrl-a
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to start of line
   memory-should-contain [
@@ -1398,10 +1418,11 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [
 ]
 
 scenario editor-moves-to-start-of-line-with-home [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   $clear-trace
   # start on second line, press 'home'
   assume-console [
@@ -1409,9 +1430,9 @@ scenario editor-moves-to-start-of-line-with-home [
     press home
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to start of line
   memory-should-contain [
@@ -1422,11 +1443,12 @@ scenario editor-moves-to-start-of-line-with-home [
 ]
 
 scenario editor-moves-to-start-of-line-with-home-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on first line (no newline before), press 'home'
   assume-console [
@@ -1434,9 +1456,9 @@ scenario editor-moves-to-start-of-line-with-home-2 [
     press home
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to start of line
   memory-should-contain [
@@ -1449,11 +1471,12 @@ scenario editor-moves-to-start-of-line-with-home-2 [
 # ctrl-e/end - move cursor to end of line
 
 scenario editor-moves-to-end-of-line-with-ctrl-e [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on first line, press ctrl-e
   assume-console [
@@ -1461,9 +1484,9 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [
     press ctrl-e
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to end of line
   memory-should-contain [
@@ -1476,9 +1499,9 @@ scenario editor-moves-to-end-of-line-with-ctrl-e [
     type [z]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   memory-should-contain [
     4 <- 1
@@ -1541,11 +1564,12 @@ def move-to-end-of-line editor:&:editor -> editor:&:editor [
 ]
 
 scenario editor-moves-to-end-of-line-with-ctrl-e-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on second line (no newline after), press ctrl-e
   assume-console [
@@ -1553,9 +1577,9 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [
     press ctrl-e
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    4:num <- get *2:&:editor, cursor-row:offset
-    5:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    4:num/raw <- get *e, cursor-row:offset
+    5:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to end of line
   memory-should-contain [
@@ -1566,11 +1590,12 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [
 ]
 
 scenario editor-moves-to-end-of-line-with-end [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on first line, press 'end'
   assume-console [
@@ -1578,9 +1603,9 @@ scenario editor-moves-to-end-of-line-with-end [
     press end
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to end of line
   memory-should-contain [
@@ -1591,11 +1616,12 @@ scenario editor-moves-to-end-of-line-with-end [
 ]
 
 scenario editor-moves-to-end-of-line-with-end-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # start on second line (no newline after), press 'end'
   assume-console [
@@ -1603,9 +1629,9 @@ scenario editor-moves-to-end-of-line-with-end-2 [
     press end
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves to end of line
   memory-should-contain [
@@ -1618,17 +1644,18 @@ scenario editor-moves-to-end-of-line-with-end-2 [
 # ctrl-u - delete text from start of line until (but not at) cursor
 
 scenario editor-deletes-to-start-of-line-with-ctrl-u [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start on second line, press ctrl-u
   assume-console [
     left-click 2, 2
     press ctrl-u
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes to start of line
   screen-should-contain [
@@ -1681,17 +1708,18 @@ def delete-to-start-of-line editor:&:editor -> result:&:duplex-list:char, editor
 ]
 
 scenario editor-deletes-to-start-of-line-with-ctrl-u-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start on first line (no newline before), press ctrl-u
   assume-console [
     left-click 1, 2
     press ctrl-u
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes to start of line
   screen-should-contain [
@@ -1704,17 +1732,18 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-2 [
 ]
 
 scenario editor-deletes-to-start-of-line-with-ctrl-u-3 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start past end of line, press ctrl-u
   assume-console [
     left-click 1, 3
     press ctrl-u
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes to start of line
   screen-should-contain [
@@ -1727,17 +1756,18 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-3 [
 ]
 
 scenario editor-deletes-to-start-of-final-line-with-ctrl-u [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start past end of final line, press ctrl-u
   assume-console [
     left-click 2, 3
     press ctrl-u
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes to start of line
   screen-should-contain [
@@ -1752,17 +1782,18 @@ scenario editor-deletes-to-start-of-final-line-with-ctrl-u [
 # ctrl-k - delete text from cursor to end of line (but not the newline)
 
 scenario editor-deletes-to-end-of-line-with-ctrl-k [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start on first line, press ctrl-k
   assume-console [
     left-click 1, 1
     press ctrl-k
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes to end of line
   screen-should-contain [
@@ -1807,17 +1838,18 @@ def delete-to-end-of-line editor:&:editor -> result:&:duplex-list:char, editor:&
 ]
 
 scenario editor-deletes-to-end-of-line-with-ctrl-k-2 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start on second line (no newline after), press ctrl-k
   assume-console [
     left-click 2, 1
     press ctrl-k
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes to end of line
   screen-should-contain [
@@ -1830,17 +1862,18 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-2 [
 ]
 
 scenario editor-deletes-to-end-of-line-with-ctrl-k-3 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start at end of line
   assume-console [
     left-click 1, 2
     press ctrl-k
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes just last character
   screen-should-contain [
@@ -1853,17 +1886,18 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-3 [
 ]
 
 scenario editor-deletes-to-end-of-line-with-ctrl-k-4 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start past end of line
   assume-console [
     left-click 1, 3
     press ctrl-k
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes nothing
   screen-should-contain [
@@ -1876,17 +1910,18 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-4 [
 ]
 
 scenario editor-deletes-to-end-of-line-with-ctrl-k-5 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start at end of text
   assume-console [
     left-click 2, 2
     press ctrl-k
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes just the final character
   screen-should-contain [
@@ -1899,17 +1934,18 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-5 [
 ]
 
 scenario editor-deletes-to-end-of-line-with-ctrl-k-6 [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [123
+  s:text <- new [123
 456]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   # start past end of text
   assume-console [
     left-click 2, 3
     press ctrl-k
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor deletes nothing
   screen-should-contain [
@@ -1924,14 +1960,15 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-6 [
 # cursor-down can scroll if necessary
 
 scenario editor-can-scroll-down-using-arrow-keys [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with >3 lines
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   screen-should-contain [
     .          .
     .a         .
@@ -1944,7 +1981,7 @@ d]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen slides by one line
   screen-should-contain [
@@ -2001,15 +2038,16 @@ def before-start-of-next-line original:&:duplex-list:char, max:num -> curr:&:dup
 ]
 
 scenario editor-scrolls-down-past-wrapped-line-using-arrow-keys [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with a long, wrapped line and more than a screen of
   # other lines
-  1:text <- new [abcdef
+  s:text <- new [abcdef
 g
 h
 i]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   screen-should-contain [
     .          .
     .abcd↩     .
@@ -2022,7 +2060,7 @@ i]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2034,21 +2072,22 @@ i]
 ]
 
 scenario editor-scrolls-down-past-wrapped-line-using-arrow-keys-2 [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # editor starts with a long line wrapping twice
-  1:text <- new [abcdefghij
+  s:text <- new [abcdefghij
 k
 l
 m]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # position cursor at last line, then try to move further down
   assume-console [
     left-click 3, 0
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line containing a wrap icon
   screen-should-contain [
@@ -2062,7 +2101,7 @@ m]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2074,22 +2113,23 @@ m]
 ]
 
 scenario editor-scrolls-down-when-line-wraps [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 5/width, 4/height
   # editor contains a long line in the third line
-  1:text <- new [a
+  s:text <- new [a
 b
 cdef]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # position cursor at end, type a character
   assume-console [
     left-click 3, 4
     type [g]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen scrolls
   screen-should-contain [
@@ -2105,21 +2145,22 @@ cdef]
 ]
 
 scenario editor-scrolls-down-on-newline [
+  local-scope
   assume-screen 5/width, 4/height
   # position cursor after last line and type newline
-  1:text <- new [a
+  s:text <- new [a
 b
 c]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   assume-console [
     left-click 3, 4
     type [
 ]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen scrolls
   screen-should-contain [
@@ -2135,22 +2176,23 @@ c]
 ]
 
 scenario editor-scrolls-down-on-right-arrow [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 5/width, 4/height
   # editor contains a wrapped line
-  1:text <- new [a
+  s:text <- new [a
 b
 cdefgh]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # position cursor at end of screen and try to move right
   assume-console [
     left-click 3, 3
     press right-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen scrolls
   screen-should-contain [
@@ -2166,23 +2208,24 @@ cdefgh]
 ]
 
 scenario editor-scrolls-down-on-right-arrow-2 [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 5/width, 4/height
   # editor contains more lines than can fit on screen
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # position cursor at end of screen and try to move right
   assume-console [
     left-click 3, 3
     press right-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen scrolls
   screen-should-contain [
@@ -2198,11 +2241,12 @@ d]
 ]
 
 scenario editor-scrolls-at-end-on-down-arrow [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  s:text <- new [abc
 de]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   $clear-trace
   # try to move down past end of text
   assume-console [
@@ -2210,9 +2254,9 @@ de]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen should scroll, moving cursor to end of text
   memory-should-contain [
@@ -2223,7 +2267,7 @@ de]
     type [0]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2238,9 +2282,9 @@ de]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen stops scrolling because cursor is already at top
   memory-should-contain [
@@ -2252,7 +2296,7 @@ de]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2263,17 +2307,18 @@ de]
 ]
 
 scenario editor-combines-page-and-line-scroll [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with a few pages of lines
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d
 e
 f
 g]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # scroll down one page and one line
   assume-console [
     press page-down
@@ -2281,7 +2326,7 @@ g]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen scrolls down 3 lines
   screen-should-contain [
@@ -2295,14 +2340,15 @@ g]
 # cursor-up can scroll if necessary
 
 scenario editor-can-scroll-up-using-arrow-keys [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with >3 lines
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   screen-should-contain [
     .          .
     .a         .
@@ -2315,7 +2361,7 @@ d]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen slides by one line
   screen-should-contain [
@@ -2382,15 +2428,16 @@ def before-previous-line in:&:duplex-list:char, editor:&:editor -> out:&:duplex-
 ]
 
 scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with a long, wrapped line and more than a screen of
   # other lines
-  1:text <- new [abcdef
+  s:text <- new [abcdef
 g
 h
 i]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   screen-should-contain [
     .          .
     .abcd↩     .
@@ -2402,7 +2449,7 @@ i]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2415,7 +2462,7 @@ i]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2427,20 +2474,21 @@ i]
 ]
 
 scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-2 [
+  local-scope
   # screen has 1 line for menu + 4 lines
   assume-screen 10/width, 5/height
   # editor starts with a long line wrapping twice, occupying 3 of the 4 lines
-  1:text <- new [abcdefghij
+  s:text <- new [abcdefghij
 k
 l
 m]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # position cursor at top of second page
   assume-console [
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2454,7 +2502,7 @@ m]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2469,7 +2517,7 @@ m]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2484,7 +2532,7 @@ m]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2499,15 +2547,16 @@ m]
 # same as editor-scrolls-up-past-wrapped-line-using-arrow-keys but length
 # slightly off, just to prevent over-training
 scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-3 [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with a long, wrapped line and more than a screen of
   # other lines
-  1:text <- new [abcdef
+  s:text <- new [abcdef
 g
 h
 i]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 6/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 6/right
   screen-should-contain [
     .          .
     .abcde↩    .
@@ -2519,7 +2568,7 @@ i]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2532,7 +2581,7 @@ i]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows partial wrapped line
   screen-should-contain [
@@ -2545,20 +2594,21 @@ i]
 
 # check empty lines
 scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-4 [
+  local-scope
   assume-screen 10/width, 4/height
   # initialize editor with some lines around an empty line
-  1:text <- new [a
+  s:text <- new [a
 b
 
 c
 d
 e]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 6/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 6/right
   assume-console [
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2570,7 +2620,7 @@ e]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2582,7 +2632,7 @@ e]
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2593,21 +2643,22 @@ e]
 ]
 
 scenario editor-scrolls-up-on-left-arrow [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 5/width, 4/height
   # editor contains >3 lines
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d
 e]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 5/right
   # position cursor at top of second page
   assume-console [
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .     .
@@ -2620,9 +2671,9 @@ e]
     press left-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen scrolls
   screen-should-contain [
@@ -2638,14 +2689,15 @@ e]
 ]
 
 scenario editor-can-scroll-up-to-start-of-file [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with >3 lines
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   screen-should-contain [
     .          .
     .a         .
@@ -2660,7 +2712,7 @@ d]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen slides by one line
   screen-should-contain [
@@ -2674,7 +2726,7 @@ d]
     press up-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen remains unchanged
   screen-should-contain [
@@ -2688,12 +2740,13 @@ d]
 # ctrl-f/page-down - render next page if it exists
 
 scenario editor-can-scroll [
+  local-scope
   assume-screen 10/width, 4/height
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   screen-should-contain [
     .          .
     .a         .
@@ -2705,7 +2758,7 @@ d]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows next page
   screen-should-contain [
@@ -2775,11 +2828,12 @@ def page-down editor:&:editor -> editor:&:editor [
 ]
 
 scenario editor-does-not-scroll-past-end [
+  local-scope
   assume-screen 10/width, 4/height
-  1:text <- new [a
+  s:text <- new [a
 b]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   screen-should-contain [
     .          .
     .a         .
@@ -2791,7 +2845,7 @@ b]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen remains unmodified
   screen-should-contain [
@@ -2803,14 +2857,15 @@ b]
 ]
 
 scenario editor-starts-next-page-at-start-of-wrapped-line [
+  local-scope
   # screen has 1 line for menu + 3 lines for text
   assume-screen 10/width, 4/height
   # editor contains a long last line
-  1:text <- new [a
+  s:text <- new [a
 b
 cdefgh]
   # editor screen triggers wrap of last line
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 4/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 4/right
   # some part of last line is not displayed
   screen-should-contain [
     .          .
@@ -2823,7 +2878,7 @@ cdefgh]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows entire wrapped line
   screen-should-contain [
@@ -2835,13 +2890,14 @@ cdefgh]
 ]
 
 scenario editor-starts-next-page-at-start-of-wrapped-line-2 [
+  local-scope
   # screen has 1 line for menu + 3 lines for text
   assume-screen 10/width, 4/height
   # editor contains a very long line that occupies last two lines of screen
   # and still has something left over
-  1:text <- new [a
+  s:text <- new [a
 bcdefgh]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 4/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 4/right
   # some part of last line is not displayed
   screen-should-contain [
     .          .
@@ -2854,7 +2910,7 @@ bcdefgh]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows entire wrapped line
   screen-should-contain [
@@ -2868,12 +2924,13 @@ bcdefgh]
 # ctrl-b/page-up - render previous page if it exists
 
 scenario editor-can-scroll-up [
+  local-scope
   assume-screen 10/width, 4/height
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   screen-should-contain [
     .          .
     .a         .
@@ -2885,7 +2942,7 @@ d]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows next page
   screen-should-contain [
@@ -2899,7 +2956,7 @@ d]
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows original page again
   screen-should-contain [
@@ -2962,10 +3019,11 @@ def page-up editor:&:editor, screen-height:num -> editor:&:editor [
 ]
 
 scenario editor-can-scroll-up-multiple-pages [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 10/width, 4/height
   # initialize editor with 8 lines
-  1:text <- new [a
+  s:text <- new [a
 b
 c
 d
@@ -2973,7 +3031,7 @@ e
 f
 g
 h]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 10/right
   screen-should-contain [
     .          .
     .a         .
@@ -2986,7 +3044,7 @@ h]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows third page
   screen-should-contain [
@@ -3000,7 +3058,7 @@ h]
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows second page
   screen-should-contain [
@@ -3014,7 +3072,7 @@ h]
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows original page again
   screen-should-contain [
@@ -3026,10 +3084,11 @@ h]
 ]
 
 scenario editor-can-scroll-up-wrapped-lines [
+  local-scope
   # screen has 1 line for menu + 5 lines for text
   assume-screen 10/width, 6/height
   # editor contains a long line in the first page
-  1:text <- new [a
+  s:text <- new [a
 b
 cdefgh
 i
@@ -3040,7 +3099,7 @@ m
 n
 o]
   # editor screen triggers wrap of last line
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 4/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 4/right
   # some part of last line is not displayed
   screen-should-contain [
     .          .
@@ -3057,7 +3116,7 @@ o]
     press down-arrow
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows entire wrapped line
   screen-should-contain [
@@ -3073,7 +3132,7 @@ o]
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen resets
   screen-should-contain [
@@ -3087,13 +3146,14 @@ o]
 ]
 
 scenario editor-can-scroll-up-wrapped-lines-2 [
+  local-scope
   # screen has 1 line for menu + 3 lines for text
   assume-screen 10/width, 4/height
   # editor contains a very long line that occupies last two lines of screen
   # and still has something left over
-  1:text <- new [a
+  s:text <- new [a
 bcdefgh]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 4/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 4/right
   # some part of last line is not displayed
   screen-should-contain [
     .          .
@@ -3106,7 +3166,7 @@ bcdefgh]
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen shows entire wrapped line
   screen-should-contain [
@@ -3120,7 +3180,7 @@ bcdefgh]
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen resets
   screen-should-contain [
@@ -3132,9 +3192,10 @@ bcdefgh]
 ]
 
 scenario editor-can-scroll-up-past-nonempty-lines [
+  local-scope
   assume-screen 10/width, 4/height
   # text with empty line in second screen
-  1:text <- new [axx
+  s:text <- new [axx
 bxx
 cxx
 dxx
@@ -3143,7 +3204,7 @@ fxx
 gxx
 hxx
 ]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 4/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 4/right
   screen-should-contain [
     .          .
     .axx       .
@@ -3154,7 +3215,7 @@ hxx
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -3166,7 +3227,7 @@ hxx
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -3179,7 +3240,7 @@ hxx
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -3190,9 +3251,10 @@ hxx
 ]
 
 scenario editor-can-scroll-up-past-empty-lines [
+  local-scope
   assume-screen 10/width, 4/height
   # text with empty line in second screen
-  1:text <- new [axy
+  s:text <- new [axy
 bxy
 cxy
 
@@ -3201,7 +3263,7 @@ exy
 fxy
 gxy
 ]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 4/right
+  e:&:editor <- new-editor s, screen:&:screen, 0/left, 4/right
   screen-should-contain [
     .          .
     .axy       .
@@ -3212,7 +3274,7 @@ gxy
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -3224,7 +3286,7 @@ gxy
     press page-down
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -3237,7 +3299,7 @@ gxy
     press page-up
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu
index c22dbeea..4c956b15 100644
--- a/edit/004-programming-environment.mu
+++ b/edit/004-programming-environment.mu
@@ -293,12 +293,11 @@ def render-without-moving-cursor screen:&:screen, editor:&:editor -> last-row:nu
 
 
 scenario point-at-multiple-editors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 30/width, 5/height
   # initialize both halves of screen
-  1:text <- new [abc]
-  2:text <- new [def]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [abc], [def]
   # focus on both sides
   assume-console [
     left-click 1, 1
@@ -306,11 +305,11 @@ scenario point-at-multiple-editors [
   ]
   # check cursor column in each
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:&:editor <- get *3:&:environment, recipes:offset
-    5:num <- get *4:&:editor, cursor-column:offset
-    6:&:editor <- get *3:&:environment, current-sandbox:offset
-    7:num <- get *6:&:editor, cursor-column:offset
+    event-loop screen:&:screen, console:&:console, env
+    recipes:&:editor <- get *env, recipes:offset
+    5:num/raw <- get *recipes, cursor-column:offset
+    sandbox:&:editor <- get *env, current-sandbox:offset
+    7:num/raw <- get *sandbox, cursor-column:offset
   ]
   memory-should-contain [
     5 <- 1
@@ -319,13 +318,12 @@ scenario point-at-multiple-editors [
 ]
 
 scenario edit-multiple-editors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 30/width, 5/height
   # initialize both halves of screen
-  1:text <- new [abc]
-  2:text <- new [def]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [abc], [def]
+  render-all screen, env, render
   # type one letter in each of them
   assume-console [
     left-click 1, 1
@@ -334,11 +332,11 @@ scenario edit-multiple-editors [
     type [1]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:&:editor <- get *3:&:environment, recipes:offset
-    5:num <- get *4:&:editor, cursor-column:offset
-    6:&:editor <- get *3:&:environment, current-sandbox:offset
-    7:num <- get *6:&:editor, cursor-column:offset
+    event-loop screen:&:screen, console:&:console, env
+    recipes:&:editor <- get *env, recipes:offset
+    5:num/raw <- get *recipes, cursor-column:offset
+    sandbox:&:editor <- get *env, current-sandbox:offset
+    7:num/raw <- get *sandbox, cursor-column:offset
   ]
   screen-should-contain [
     .           run (F4)           .  # this line has a different background, but we don't test that yet
@@ -352,8 +350,8 @@ scenario edit-multiple-editors [
   ]
   # show the cursor at the right window
   run [
-    8:char/cursor <- copy 9251/␣
-    print screen:&:screen, 8:char/cursor
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   screen-should-contain [
     .           run (F4)           .
@@ -364,13 +362,12 @@ scenario edit-multiple-editors [
 ]
 
 scenario multiple-editors-cover-only-their-own-areas [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 60/width, 10/height
   run [
-    1:text <- new [abc]
-    2:text <- new [def]
-    3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-    render-all screen, 3:&:environment, render
+    env:&:environment <- new-programming-environment screen:&:screen, [abc], [def]
+    render-all screen, env, render
   ]
   # divider isn't messed up
   screen-should-contain [
@@ -383,18 +380,17 @@ scenario multiple-editors-cover-only-their-own-areas [
 ]
 
 scenario editor-in-focus-keeps-cursor [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 30/width, 5/height
-  1:text <- new [abc]
-  2:text <- new [def]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [abc], [def]
+  render-all screen, env, render
   # initialize programming environment and highlight cursor
   assume-console []
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # is cursor at the right place?
   screen-should-contain [
@@ -408,9 +404,9 @@ scenario editor-in-focus-keeps-cursor [
     type [z]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # cursor should still be right
   screen-should-contain [
@@ -422,14 +418,14 @@ scenario editor-in-focus-keeps-cursor [
 ]
 
 scenario backspace-in-sandbox-editor-joins-lines [
-#?   trace-until 100/app  # trace too long
+  local-scope
+  trace-until 100/app  # trace too long
   assume-screen 30/width, 5/height
   # initialize sandbox side with two lines
-  1:text <- new []
-  2:text <- new [abc
+  s:text <- new [abc
 def]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], s:text
+  render-all screen, env, render
   screen-should-contain [
     .           run (F4)           .
     .               ┊abc           .
@@ -443,9 +439,9 @@ def]
     press backspace
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # cursor moves to end of old line
   screen-should-contain [
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 7962aa2a..661b6582 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -42,19 +42,18 @@ container sandbox [
 ]
 
 scenario run-and-show-results [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
   # recipe editor is empty
-  1:text <- new []
   # sandbox editor contains an instruction without storing outputs
-  2:text <- new [divide-with-remainder 11, 3]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], [divide-with-remainder 11, 3]
   # run the code in the editors
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # check that screen prints the results
   screen-should-contain [
@@ -104,9 +103,9 @@ scenario run-and-show-results [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
-  # check that screen prints the results
+  # check that screen prints both sandboxes
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -516,23 +515,23 @@ def render-screen screen:&:screen, sandbox-screen:&:screen, left:num, right:num,
 ]
 
 scenario run-updates-results [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 12/height
   # define a recipe (no indent for the 'add' line below so column numbers are more obvious)
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
 local-scope
 z:num <- add 2, 2
 reply z
 ]]
   # sandbox editor contains an instruction without storing outputs
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run the code in the editors
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -552,7 +551,7 @@ reply z
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # check that screen updates the result on the right
   screen-should-contain [
@@ -569,19 +568,18 @@ reply z
 ]
 
 scenario run-instruction-manages-screen-per-sandbox [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 20/height
   # left editor is empty
-  1:text <- new []
   # right editor contains an instruction
-  2:text <- new [print-integer screen, 4]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], [print-integer screen, 4]
   # run the code in the editor
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # check that it prints a little toy screen
   screen-should-contain [
@@ -621,20 +619,20 @@ def editor-contents editor:&:editor -> result:text [
 ]
 
 scenario editor-provides-edited-contents [
+  local-scope
   assume-screen 10/width, 5/height
-  1:text <- new [abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
+  e:&:editor <- new-editor [abc], screen:&:screen, 0/left, 10/right
   assume-console [
     left-click 1, 2
     type [def]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:text <- editor-contents 2:&:editor
-    4:@:char <- copy *3:text
+    editor-event-loop screen:&:screen, console:&:console, e
+    s:text <- editor-contents e
+    1:@:char/raw <- copy *s
   ]
   memory-should-contain [
-    4:array:character <- [abdefc]
+    1:array:character <- [abdefc]
   ]
 ]
 
@@ -795,18 +793,17 @@ cd]
 # scrolling through sandboxes
 
 scenario scrolling-down-past-bottom-of-sandbox-editor [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize sandbox side
-  1:text <- new []
-  2:text <- new [add 2, 2]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], [add 2, 2]
+  render-all screen, env, render
   assume-console [
     # create a sandbox
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -820,9 +817,9 @@ scenario scrolling-down-past-bottom-of-sandbox-editor [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # sandbox editor hidden; first sandbox displayed
   # cursor moves to first sandbox
@@ -838,9 +835,9 @@ scenario scrolling-down-past-bottom-of-sandbox-editor [
     press page-up
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # sandbox editor displays again, cursor is in editor
   screen-should-contain [
@@ -928,27 +925,27 @@ def previous-sandbox env:&:environment, in:&:sandbox -> out:&:sandbox [
 ]
 
 scenario scrolling-down-on-recipe-side [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize sandbox side and create a sandbox
-  1:text <- new [ 
+  recipes:text <- new [ 
 ]
   # create a sandbox
-  2:text <- new [add 2, 2]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, recipes:text, [add 2, 2]
+  render-all screen, env, render
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   # hit 'down' in recipe editor
   assume-console [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # cursor moves down on recipe side
   screen-should-contain [
@@ -961,13 +958,12 @@ scenario scrolling-down-on-recipe-side [
 ]
 
 scenario scrolling-through-multiple-sandboxes [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes
   assume-console [
     press ctrl-n
@@ -976,9 +972,9 @@ scenario scrolling-through-multiple-sandboxes [
     type [add 1, 1]
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
-  4:char/cursor <- copy 9251/␣
-  print screen:&:screen, 4:char/cursor
+  event-loop screen:&:screen, console:&:console, env
+  cursor:char <- copy 9251/␣
+  print screen:&:screen, cursor
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊␣                                                .
@@ -996,9 +992,9 @@ scenario scrolling-through-multiple-sandboxes [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # sandbox editor hidden; first sandbox displayed
   # cursor moves to first sandbox
@@ -1018,7 +1014,7 @@ scenario scrolling-through-multiple-sandboxes [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # just second sandbox displayed
   screen-should-contain [
@@ -1035,7 +1031,7 @@ scenario scrolling-through-multiple-sandboxes [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # no change
   screen-should-contain [
@@ -1052,7 +1048,7 @@ scenario scrolling-through-multiple-sandboxes [
     press page-up
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # back to displaying both sandboxes without editor
   screen-should-contain [
@@ -1071,9 +1067,9 @@ scenario scrolling-through-multiple-sandboxes [
     press page-up
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # back to displaying both sandboxes as well as editor
   screen-should-contain [
@@ -1093,9 +1089,9 @@ scenario scrolling-through-multiple-sandboxes [
     press page-up
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # no change
   screen-should-contain [
@@ -1113,20 +1109,19 @@ scenario scrolling-through-multiple-sandboxes [
 ]
 
 scenario scrolling-manages-sandbox-index-correctly [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create a sandbox
   assume-console [
     press ctrl-n
     type [add 1, 1]
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -1142,7 +1137,7 @@ scenario scrolling-manages-sandbox-index-correctly [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # sandbox editor hidden; first sandbox displayed
   # cursor moves to first sandbox
@@ -1160,7 +1155,7 @@ scenario scrolling-manages-sandbox-index-correctly [
     press page-up
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # back to displaying both sandboxes as well as editor
   screen-should-contain [
@@ -1178,7 +1173,7 @@ scenario scrolling-manages-sandbox-index-correctly [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # sandbox editor hidden; first sandbox displayed
   # cursor moves to first sandbox
diff --git a/edit/006-sandbox-copy.mu b/edit/006-sandbox-copy.mu
index f5c9f4cc..a2425858 100644
--- a/edit/006-sandbox-copy.mu
+++ b/edit/006-sandbox-copy.mu
@@ -2,20 +2,20 @@
 ## see code operate in multiple situations
 
 scenario copy-a-sandbox-to-editor [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -31,7 +31,7 @@ recipe foo [
     left-click 3, 69
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # it copies into editor
   screen-should-contain [
@@ -49,7 +49,7 @@ recipe foo [
     type [0]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -64,20 +64,20 @@ recipe foo [
 ]
 
 scenario copy-a-sandbox-to-editor-2 [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -93,7 +93,7 @@ recipe foo [
     left-click 3, 84
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # it copies into editor
   screen-should-contain [
@@ -111,7 +111,7 @@ recipe foo [
     type [0]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -221,20 +221,20 @@ def within-range? x:num, low:num, high:num -> result:bool [
 ]
 
 scenario copy-fails-if-sandbox-editor-not-empty [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -252,7 +252,7 @@ recipe foo [
     left-click 3, 70  # click 'copy' button
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # copy doesn't happen
   screen-should-contain [
@@ -270,7 +270,7 @@ recipe foo [
     type [1]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
diff --git a/edit/007-sandbox-delete.mu b/edit/007-sandbox-delete.mu
index 1eb2c904..141c1528 100644
--- a/edit/007-sandbox-delete.mu
+++ b/edit/007-sandbox-delete.mu
@@ -1,11 +1,10 @@
 ## deleting sandboxes
 
 scenario deleting-sandboxes [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
   # run a few commands
   assume-console [
     left-click 1, 80
@@ -14,7 +13,7 @@ scenario deleting-sandboxes [
     type [add 2, 2]
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -35,7 +34,7 @@ scenario deleting-sandboxes [
     left-click 7, 85
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -53,7 +52,7 @@ scenario deleting-sandboxes [
     left-click 3, 99
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -148,13 +147,12 @@ def delete-sandbox env:&:environment, sandbox:&:sandbox -> env:&:environment [
 ]
 
 scenario deleting-sandbox-after-scroll [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes and scroll to second
   assume-console [
     press ctrl-n
@@ -164,7 +162,7 @@ scenario deleting-sandbox-after-scroll [
     press F4
     press page-down
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -179,7 +177,7 @@ scenario deleting-sandbox-after-scroll [
     left-click 6, 99
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # second sandbox shows in editor; scroll resets to display first sandbox
   screen-should-contain [
@@ -194,13 +192,12 @@ scenario deleting-sandbox-after-scroll [
 ]
 
 scenario deleting-top-sandbox-after-scroll [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes and scroll to second
   assume-console [
     press ctrl-n
@@ -210,7 +207,7 @@ scenario deleting-top-sandbox-after-scroll [
     press F4
     press page-down
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -225,7 +222,7 @@ scenario deleting-top-sandbox-after-scroll [
     left-click 2, 99
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # second sandbox shows in editor; scroll resets to display first sandbox
   screen-should-contain [
@@ -240,13 +237,12 @@ scenario deleting-top-sandbox-after-scroll [
 ]
 
 scenario deleting-final-sandbox-after-scroll [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes and scroll to second
   assume-console [
     press ctrl-n
@@ -257,7 +253,7 @@ scenario deleting-final-sandbox-after-scroll [
     press page-down
     press page-down
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -272,7 +268,7 @@ scenario deleting-final-sandbox-after-scroll [
     left-click 2, 99
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # implicitly scroll up to first sandbox
   screen-should-contain [
@@ -288,13 +284,12 @@ scenario deleting-final-sandbox-after-scroll [
 ]
 
 scenario deleting-updates-sandbox-count [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes
   assume-console [
     press ctrl-n
@@ -303,7 +298,7 @@ scenario deleting-updates-sandbox-count [
     type [add 1, 1]
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -323,7 +318,7 @@ scenario deleting-updates-sandbox-count [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # shouldn't go past last sandbox
   screen-should-contain [
diff --git a/edit/008-sandbox-edit.mu b/edit/008-sandbox-edit.mu
index 034c1a37..5b2dfe9a 100644
--- a/edit/008-sandbox-edit.mu
+++ b/edit/008-sandbox-edit.mu
@@ -1,20 +1,20 @@
 ## editing sandboxes after they've been created
 
 scenario clicking-on-a-sandbox-moves-it-to-editor [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -30,7 +30,7 @@ recipe foo [
     left-click 3, 55
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # it pops back into editor
   screen-should-contain [
@@ -47,7 +47,7 @@ recipe foo [
     type [0]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -61,20 +61,20 @@ recipe foo [
 ]
 
 scenario clicking-on-a-sandbox-moves-it-to-editor-2 [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -90,7 +90,7 @@ recipe foo [
     left-click 3, 68
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # it pops back into editor
   screen-should-contain [
@@ -107,7 +107,7 @@ recipe foo [
     type [0]
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -174,18 +174,17 @@ def try-edit-sandbox click-row:num, env:&:environment -> clicked-on-edit-button?
 ]
 
 scenario sandbox-with-print-can-be-edited [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 20/height
   # left editor is empty
-  1:text <- new []
   # right editor contains an instruction
-  2:text <- new [print-integer screen, 4]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], [print-integer screen, 4]
   # run the sandbox
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -206,7 +205,7 @@ scenario sandbox-with-print-can-be-edited [
     left-click 3, 65
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -218,13 +217,12 @@ scenario sandbox-with-print-can-be-edited [
 ]
 
 scenario editing-sandbox-after-scrolling-resets-scroll [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes and scroll to second
   assume-console [
     press ctrl-n
@@ -235,7 +233,7 @@ scenario editing-sandbox-after-scrolling-resets-scroll [
     press page-down
     press page-down
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
@@ -250,7 +248,7 @@ scenario editing-sandbox-after-scrolling-resets-scroll [
     left-click 2, 55
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # second sandbox shows in editor; scroll resets to display first sandbox
   screen-should-contain [
@@ -266,13 +264,12 @@ scenario editing-sandbox-after-scrolling-resets-scroll [
 ]
 
 scenario editing-sandbox-updates-sandbox-count [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # initialize environment
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  render-all screen, 3:&:environment, render
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
+  render-all screen, env, render
   # create 2 sandboxes
   assume-console [
     press ctrl-n
@@ -281,7 +278,7 @@ scenario editing-sandbox-updates-sandbox-count [
     type [add 1, 1]
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -300,7 +297,7 @@ scenario editing-sandbox-updates-sandbox-count [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # no change in contents
   screen-should-contain [
@@ -322,7 +319,7 @@ scenario editing-sandbox-updates-sandbox-count [
     press page-down
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # screen should show just final sandbox with the right index (1)
   screen-should-contain [
diff --git a/edit/009-sandbox-test.mu b/edit/009-sandbox-test.mu
index 7b1f1f18..d5d67f57 100644
--- a/edit/009-sandbox-test.mu
+++ b/edit/009-sandbox-test.mu
@@ -1,20 +1,20 @@
 ## clicking on sandbox results to 'fix' them and turn sandboxes into tests
 
 scenario sandbox-click-on-result-toggles-color-to-green [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes:text, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -30,7 +30,7 @@ recipe foo [
     left-click 5, 51
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # color toggles to green
   screen-should-contain-in-color 2/green, [
@@ -45,8 +45,8 @@ recipe foo [
   ]
   # cursor should remain unmoved
   run [
-    4:char/cursor <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   screen-should-contain [
     .                                                                                 run (F4)           .
@@ -69,7 +69,7 @@ recipe foo [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # result turns red
   screen-should-contain-in-color 1/red, [
diff --git a/edit/010-sandbox-trace.mu b/edit/010-sandbox-trace.mu
index 195d0fd5..21a3aec2 100644
--- a/edit/010-sandbox-trace.mu
+++ b/edit/010-sandbox-trace.mu
@@ -1,20 +1,20 @@
 ## clicking on the code typed into a sandbox toggles its trace
 
 scenario sandbox-click-on-code-toggles-app-trace [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   stash [abc]
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -29,9 +29,9 @@ recipe foo [
     left-click 4, 51
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    4:char/cursor-icon <- copy 9251/␣
-    print screen:&:screen, 4:char/cursor-icon
+    event-loop screen:&:screen, console:&:console, env
+    cursor:char <- copy 9251/␣
+    print screen:&:screen, cursor
   ]
   # trace now printed and cursor shouldn't have budged
   screen-should-contain [
@@ -55,8 +55,8 @@ recipe foo [
     left-click 4, 55
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
-    print screen:&:screen, 4:char/cursor-icon
+    event-loop screen:&:screen, console:&:console, env
+    print screen:&:screen, cursor
   ]
   # trace hidden again
   screen-should-contain [
@@ -71,21 +71,21 @@ recipe foo [
 ]
 
 scenario sandbox-shows-app-trace-and-result [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # basic recipe
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   stash [abc]
   reply 4
 ]]
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run it
-  2:text <- new [foo]
   assume-console [
     press F4
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -101,7 +101,7 @@ recipe foo [
     left-click 4, 51
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # trace now printed above result
   screen-should-contain [
@@ -119,17 +119,16 @@ recipe foo [
 ]
 
 scenario clicking-on-app-trace-does-nothing [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
-  1:text <- new []
+  env:&:environment <- new-programming-environment screen:&:screen, [], [stash 123456789]
   # create and expand the trace
-  2:text <- new [stash 123456789]
   assume-console [
     press F4
     left-click 4, 51
   ]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .                                                                                 run (F4)           .
     .                                                  ┊                                                 .
@@ -143,7 +142,7 @@ scenario clicking-on-app-trace-does-nothing [
     left-click 5, 57
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # no change; doesn't die
   screen-should-contain [
diff --git a/edit/011-errors.mu b/edit/011-errors.mu
index 2764de7d..1483a1af 100644
--- a/edit/011-errors.mu
+++ b/edit/011-errors.mu
@@ -115,19 +115,19 @@ after <render-sandbox-trace-done> [
 ]
 
 scenario run-shows-errors-in-get [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   get 123:num, foo:offset
 ]]
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
@@ -155,11 +155,10 @@ recipe foo [
 ]
 
 scenario run-updates-status-with-first-erroneous-sandbox [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
   assume-console [
     left-click 3, 80
     # create invalid sandbox 1
@@ -170,7 +169,7 @@ scenario run-updates-status-with-first-erroneous-sandbox [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # status line shows that error is in first sandbox
   screen-should-contain [
@@ -179,11 +178,10 @@ scenario run-updates-status-with-first-erroneous-sandbox [
 ]
 
 scenario run-updates-status-with-first-erroneous-sandbox-2 [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new []
-  2:text <- new []
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], []
   assume-console [
     left-click 3, 80
     # create invalid sandbox 2
@@ -197,7 +195,7 @@ scenario run-updates-status-with-first-erroneous-sandbox-2 [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # status line shows that error is in second sandbox
   screen-should-contain [
@@ -206,16 +204,15 @@ scenario run-updates-status-with-first-erroneous-sandbox-2 [
 ]
 
 scenario run-hides-errors-from-past-sandboxes [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new []
-  2:text <- new [get foo, x:offset]  # invalid
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, [], [get foo, x:offset]  # invalid
   assume-console [
     press F4  # generate error
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   assume-console [
     left-click 3, 58
@@ -224,7 +221,7 @@ scenario run-hides-errors-from-past-sandboxes [
     press F4  # update sandbox
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # error should disappear
   screen-should-contain [
@@ -240,21 +237,21 @@ scenario run-hides-errors-from-past-sandboxes [
 ]
 
 scenario run-updates-errors-for-shape-shifting-recipes [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
   # define a shape-shifting recipe with an error
-  1:text <- new [recipe foo x:_elem -> z:_elem [
+  recipes:text <- new [recipe foo x:_elem -> z:_elem [
 local-scope
 load-ingredients
 y:&:num <- copy 0
 z <- add x, y
 ]]
-  2:text <- new [foo 2]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo 2]
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .  errors found (0)                                                               run (F4)           .
     .recipe foo x:_elem -> z:_elem [                   ┊                                                 .
@@ -271,7 +268,7 @@ z <- add x, y
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # error should remain unchanged
   screen-should-contain [
@@ -288,20 +285,21 @@ z <- add x, y
 ]
 
 scenario run-avoids-spurious-errors-on-reloading-shape-shifting-recipes [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
   # overload a well-known shape-shifting recipe
-  1:text <- new [recipe length l:&:list:_elem -> n:num [
+  recipes:text <- new [recipe length l:&:list:_elem -> n:num [
 ]]
   # call code that uses other variants of it, but not it itself
-  2:text <- new [x:&:list:num <- copy 0
+  sandbox:text <- new [x:&:list:num <- copy 0
 to-text x]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, sandbox
   # run it once
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   # no errors anywhere on screen (can't check anything else, since to-text will return an address)
   screen-should-contain-in-color 1/red, [
     .                                                                                                    .
@@ -325,7 +323,7 @@ to-text x]
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # still no errors
   screen-should-contain-in-color 1/red, [
@@ -348,19 +346,19 @@ to-text x]
 ]
 
 scenario run-shows-missing-type-errors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   x <- copy 0
 ]]
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
@@ -373,20 +371,20 @@ recipe foo [
 ]
 
 scenario run-shows-unbalanced-bracket-errors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
   # recipe is incomplete (unbalanced '[')
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo \\[
   x <- copy 0
 ]
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
@@ -401,21 +399,21 @@ recipe foo \\[
 ]
 
 scenario run-shows-get-on-non-container-errors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   local-scope
   x:&:point <- new point:type
   get x:&:point, 1:offset
 ]]
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
@@ -433,22 +431,22 @@ recipe foo [
 ]
 
 scenario run-shows-non-literal-get-argument-errors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 15/height
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   local-scope
   x:num <- copy 0
   y:&:point <- new point:type
   get *y:&:point, x:num
 ]]
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
@@ -467,20 +465,20 @@ recipe foo [
 ]
 
 scenario run-shows-errors-everytime [
+  local-scope
   trace-until 100/app  # trace too long
   # try to run a file with an error
   assume-screen 100/width, 15/height
-  1:text <- new [ 
+  recipes:text <- new [ 
 recipe foo [
   local-scope
   x:num <- copy y:num
 ]]
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
     .                                                  ┊foo                                              .
@@ -497,7 +495,7 @@ recipe foo [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found                                                                   run (F4)           .
@@ -513,19 +511,18 @@ recipe foo [
 ]
 
 scenario run-instruction-and-print-errors [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
-  # left editor is empty
-  1:text <- new []
   # right editor contains an illegal instruction
-  2:text <- new [get 1234:num, foo:offset]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  sandbox:text <- new [get 1234:num, foo:offset]
+  env:&:environment <- new-programming-environment screen:&:screen, [], sandbox
   # run the code in the editors
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # check that screen prints error message in red
   screen-should-contain [
@@ -576,20 +573,19 @@ scenario run-instruction-and-print-errors [
 ]
 
 scenario run-instruction-and-print-errors-only-once [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
-  # left editor is empty
-  1:text <- new []
   # right editor contains an illegal instruction
-  2:text <- new [get 1234:num, foo:offset]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  sandbox:text <- new [get 1234:num, foo:offset]
+  env:&:environment <- new-programming-environment screen:&:screen, [], sandbox
   # run the code in the editors multiple times
   assume-console [
     press F4
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # check that screen prints error message just once
   screen-should-contain [
@@ -607,23 +603,23 @@ scenario run-instruction-and-print-errors-only-once [
 ]
 
 scenario sandbox-can-handle-infinite-loop [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 20/height
   # left editor is empty
-  1:text <- new [recipe foo [
+  recipes:text <- new [recipe foo [
   {
     loop
   }
 ]]
   # right editor contains an instruction
-  2:text <- new [foo]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo]
   # run the sandbox
   assume-console [
     press F4
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   screen-should-contain [
     .  errors found (0)                                                               run (F4)           .
@@ -638,10 +634,11 @@ scenario sandbox-can-handle-infinite-loop [
 ]
 
 scenario sandbox-with-errors-shows-trace [
+  local-scope
   trace-until 100/app  # trace too long
   assume-screen 100/width, 10/height
   # generate a stash and a error
-  1:text <- new [recipe foo [
+  recipes:text <- new [recipe foo [
 local-scope
 a:num <- next-ingredient
 b:num <- next-ingredient
@@ -649,13 +646,12 @@ stash [dividing by], b
 _, c:num <- divide-with-remainder a, b
 reply b
 ]]
-  2:text <- new [foo 4, 0]
-  3:&:environment <- new-programming-environment screen:&:screen, 1:text, 2:text
+  env:&:environment <- new-programming-environment screen:&:screen, recipes, [foo 4, 0]
   # run
   assume-console [
     press F4
   ]
-  event-loop screen:&:screen, console:&:console, 3:&:environment
+  event-loop screen:&:screen, console:&:console, env
   # screen prints error message
   screen-should-contain [
     .  errors found (0)                                                               run (F4)           .
@@ -673,7 +669,7 @@ reply b
     left-click 4, 55
   ]
   run [
-    event-loop screen:&:screen, console:&:console, 3:&:environment
+    event-loop screen:&:screen, console:&:console, env
   ]
   # screen should expand trace
   screen-should-contain [
diff --git a/edit/012-editor-undo.mu b/edit/012-editor-undo.mu
index 428d51ca..48179c63 100644
--- a/edit/012-editor-undo.mu
+++ b/edit/012-editor-undo.mu
@@ -99,21 +99,21 @@ after <handle-special-character> [
 # undo typing
 
 scenario editor-can-undo-typing [
+  local-scope
   # create an editor and type a character
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     type [0]
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # character should be gone
   screen-should-contain [
@@ -127,7 +127,7 @@ scenario editor-can-undo-typing [
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -229,21 +229,21 @@ after <handle-undo> [
 ]
 
 scenario editor-can-undo-typing-multiple [
+  local-scope
   # create an editor and type multiple characters
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     type [012]
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # all characters must be gone
   screen-should-contain [
@@ -255,16 +255,16 @@ scenario editor-can-undo-typing-multiple [
 ]
 
 scenario editor-can-undo-typing-multiple-2 [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [a]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [a], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # type some characters
   assume-console [
     type [012]
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .012a      .
@@ -276,7 +276,7 @@ scenario editor-can-undo-typing-multiple-2 [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # back to original text
   screen-should-contain [
@@ -290,7 +290,7 @@ scenario editor-can-undo-typing-multiple-2 [
     type [3]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -301,17 +301,17 @@ scenario editor-can-undo-typing-multiple-2 [
 ]
 
 scenario editor-can-undo-typing-enter [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [  abc]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [  abc], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # new line
   assume-console [
     left-click 1, 8
     press enter
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .  abc     .
@@ -320,8 +320,8 @@ scenario editor-can-undo-typing-enter [
     .          .
   ]
   # line is indented
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 2
@@ -331,10 +331,10 @@ scenario editor-can-undo-typing-enter [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 5
@@ -351,7 +351,7 @@ scenario editor-can-undo-typing-enter [
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -364,16 +364,16 @@ scenario editor-can-undo-typing-enter [
 # redo typing
 
 scenario editor-redo-typing [
+  local-scope
   # create an editor, type something, undo
   assume-screen 10/width, 5/height
-  1:text <- new [a]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [a], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     type [012]
     press ctrl-z
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .a         .
@@ -385,7 +385,7 @@ scenario editor-redo-typing [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # all characters must be back
   screen-should-contain [
@@ -399,7 +399,7 @@ scenario editor-redo-typing [
     type [3]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -428,16 +428,16 @@ after <handle-redo> [
 ]
 
 scenario editor-redo-typing-empty [
+  local-scope
   # create an editor, type something, undo
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     type [012]
     press ctrl-z
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .          .
@@ -449,7 +449,7 @@ scenario editor-redo-typing-empty [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # all characters must be back
   screen-should-contain [
@@ -463,7 +463,7 @@ scenario editor-redo-typing-empty [
     type [3]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -474,23 +474,24 @@ scenario editor-redo-typing-empty [
 ]
 
 scenario editor-work-clears-redo-stack [
+  local-scope
   # create an editor with some text, do some work, undo
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     type [1]
     press ctrl-z
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # do some more work
   assume-console [
     type [0]
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .0abc      .
@@ -503,7 +504,7 @@ ghi]
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # nothing should happen
   screen-should-contain [
@@ -516,11 +517,11 @@ ghi]
 ]
 
 scenario editor-can-redo-typing-and-enter-and-tab [
+  local-scope
   # create an editor
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # insert some text and tabs, hit enter, some more text and tabs
   assume-console [
     press tab
@@ -531,7 +532,7 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press tab
     type [efg]
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .  ab  cd  .
@@ -539,8 +540,8 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 7
@@ -550,11 +551,11 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # typing in second line deleted, but not indent
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 2
@@ -571,11 +572,11 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # indent and newline deleted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 8
@@ -591,11 +592,11 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # empty screen
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 0
@@ -611,11 +612,11 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # first line inserted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 8
@@ -631,11 +632,11 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # newline and indent inserted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 2
@@ -652,11 +653,11 @@ scenario editor-can-redo-typing-and-enter-and-tab [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # indent and newline deleted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 7
@@ -673,28 +674,29 @@ scenario editor-can-redo-typing-and-enter-and-tab [
 # undo cursor movement and scroll
 
 scenario editor-can-undo-touch [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor
   assume-console [
     left-click 3, 1
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # click undone
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 0
@@ -704,7 +706,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -763,21 +765,22 @@ after <handle-undo> [
 ]
 
 scenario editor-can-undo-scroll [
+  local-scope
   # screen has 1 line for menu + 3 lines
   assume-screen 5/width, 4/height
   # editor contains a wrapped line
-  1:text <- new [a
+  contents:text <- new [a
 b
 cdefgh]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 5/right
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 5/right
   # position cursor at end of screen and try to move right
   assume-console [
     left-click 3, 3
     press right-arrow
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  editor-event-loop screen:&:screen, console:&:console, e
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   # screen scrolls
   screen-should-contain [
     .     .
@@ -794,11 +797,11 @@ cdefgh]
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moved back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 3
     4 <- 3
@@ -815,7 +818,7 @@ cdefgh]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .     .
@@ -826,29 +829,30 @@ cdefgh]
 ]
 
 scenario editor-can-undo-left-arrow [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor
   assume-console [
     left-click 3, 1
     press left-arrow
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 3
     4 <- 1
@@ -858,7 +862,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -870,21 +874,22 @@ ghi]
 ]
 
 scenario editor-can-undo-up-arrow [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor
   assume-console [
     left-click 3, 1
     press up-arrow
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  editor-event-loop screen:&:screen, console:&:console, e
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -894,11 +899,11 @@ ghi]
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 3
     4 <- 1
@@ -908,7 +913,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -920,29 +925,30 @@ ghi]
 ]
 
 scenario editor-can-undo-down-arrow [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor
   assume-console [
     left-click 2, 1
     press down-arrow
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -952,7 +958,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -964,29 +970,28 @@ ghi]
 ]
 
 scenario editor-can-undo-ctrl-f [
+  local-scope
   # create an editor with multiple pages of text
   assume-screen 10/width, 5/height
-  1:text <- new [a
+  contents:text <- new [a
 b
 c
 d
 e
 f]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # scroll the page
   assume-console [
     press ctrl-f
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen should again show page 1
   screen-should-contain [
@@ -999,29 +1004,28 @@ f]
 ]
 
 scenario editor-can-undo-page-down [
+  local-scope
   # create an editor with multiple pages of text
   assume-screen 10/width, 5/height
-  1:text <- new [a
+  contents:text <- new [a
 b
 c
 d
 e
 f]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # scroll the page
   assume-console [
     press page-down
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen should again show page 1
   screen-should-contain [
@@ -1034,30 +1038,29 @@ f]
 ]
 
 scenario editor-can-undo-ctrl-b [
+  local-scope
   # create an editor with multiple pages of text
   assume-screen 10/width, 5/height
-  1:text <- new [a
+  contents:text <- new [a
 b
 c
 d
 e
 f]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # scroll the page down and up
   assume-console [
     press page-down
     press ctrl-b
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen should again show page 2
   screen-should-contain [
@@ -1070,30 +1073,29 @@ f]
 ]
 
 scenario editor-can-undo-page-up [
+  local-scope
   # create an editor with multiple pages of text
   assume-screen 10/width, 5/height
-  1:text <- new [a
+  contents:text <- new [a
 b
 c
 d
 e
 f]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # scroll the page down and up
   assume-console [
     press page-down
     press page-up
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # screen should again show page 2
   screen-should-contain [
@@ -1106,29 +1108,30 @@ f]
 ]
 
 scenario editor-can-undo-ctrl-a [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor, then to start of line
   assume-console [
     left-click 2, 1
     press ctrl-a
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -1138,7 +1141,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1150,29 +1153,30 @@ ghi]
 ]
 
 scenario editor-can-undo-home [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor, then to start of line
   assume-console [
     left-click 2, 1
     press home
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -1182,7 +1186,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1194,29 +1198,30 @@ ghi]
 ]
 
 scenario editor-can-undo-ctrl-e [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor, then to start of line
   assume-console [
     left-click 2, 1
     press ctrl-e
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -1226,7 +1231,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1238,29 +1243,30 @@ ghi]
 ]
 
 scenario editor-can-undo-end [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor, then to start of line
   assume-console [
     left-click 2, 1
     press end
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # undo
   assume-console [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves back
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -1270,7 +1276,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1282,13 +1288,14 @@ ghi]
 ]
 
 scenario editor-can-undo-multiple-arrows-in-the-same-direction [
+  local-scope
   # create an editor with some text
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # move the cursor
   assume-console [
     left-click 2, 1
@@ -1296,9 +1303,9 @@ ghi]
     press right-arrow
     press up-arrow
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  editor-event-loop screen:&:screen, console:&:console, e
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 3
@@ -1308,11 +1315,11 @@ ghi]
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # up-arrow is undone
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 3
@@ -1322,11 +1329,11 @@ ghi]
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # both right-arrows are undone
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 2
     4 <- 1
@@ -1336,28 +1343,29 @@ ghi]
 # redo cursor movement and scroll
 
 scenario editor-redo-touch [
+  local-scope
   # create an editor with some text, click on a character, undo
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def
 ghi]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     left-click 3, 1
     press ctrl-z
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   # redo
   assume-console [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # cursor moves to left-click
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 3
     4 <- 1
@@ -1367,7 +1375,7 @@ ghi]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1393,19 +1401,19 @@ after <handle-redo> [
 ]
 
 scenario editor-separates-undo-insert-from-undo-cursor-move [
+  local-scope
   # create an editor, type some text, move the cursor, type some more text
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   assume-console [
     type [abc]
     left-click 1, 1
     type [d]
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  editor-event-loop screen:&:screen, console:&:console, e
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   screen-should-contain [
     .          .
     .adbc      .
@@ -1421,9 +1429,9 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # last letter typed is deleted
   screen-should-contain [
@@ -1441,9 +1449,9 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # no change to screen; cursor moves
   screen-should-contain [
@@ -1461,9 +1469,9 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # screen empty
   screen-should-contain [
@@ -1481,9 +1489,9 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # first insert
   screen-should-contain [
@@ -1501,9 +1509,9 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # cursor moves
   screen-should-contain [
@@ -1522,9 +1530,9 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
-    3:num <- get *2:&:editor, cursor-row:offset
-    4:num <- get *2:&:editor, cursor-column:offset
+    editor-event-loop screen:&:screen, console:&:console, e
+    3:num/raw <- get *e, cursor-row:offset
+    4:num/raw <- get *e, cursor-column:offset
   ]
   # second insert
   screen-should-contain [
@@ -1542,26 +1550,26 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [
 # undo backspace
 
 scenario editor-can-undo-and-redo-backspace [
+  local-scope
   # create an editor
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # insert some text and hit backspace
   assume-console [
     type [abc]
     press backspace
     press backspace
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .a         .
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1571,10 +1579,10 @@ scenario editor-can-undo-and-redo-backspace [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 3
@@ -1590,10 +1598,10 @@ scenario editor-can-undo-and-redo-backspace [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1687,11 +1695,11 @@ after <handle-redo> [
 # undo delete
 
 scenario editor-can-undo-and-redo-delete [
+  local-scope
   # create an editor
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # insert some text and hit delete and backspace a few times
   assume-console [
     type [abcdef]
@@ -1701,15 +1709,15 @@ scenario editor-can-undo-and-redo-delete [
     press delete
     press delete
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .af        .
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1719,10 +1727,10 @@ scenario editor-can-undo-and-redo-delete [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1738,10 +1746,10 @@ scenario editor-can-undo-and-redo-delete [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 2
@@ -1757,10 +1765,10 @@ scenario editor-can-undo-and-redo-delete [
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 2
@@ -1776,11 +1784,11 @@ scenario editor-can-undo-and-redo-delete [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # first line inserted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 2
@@ -1796,11 +1804,11 @@ scenario editor-can-undo-and-redo-delete [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # first line inserted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1816,11 +1824,11 @@ scenario editor-can-undo-and-redo-delete [
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # first line inserted
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1876,18 +1884,19 @@ before <delete-character-end> [
 # undo ctrl-k
 
 scenario editor-can-undo-and-redo-ctrl-k [
+  local-scope
   # create an editor
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # insert some text and hit delete and backspace a few times
   assume-console [
     left-click 1, 1
     press ctrl-k
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .a         .
@@ -1895,8 +1904,8 @@ def]
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1906,7 +1915,7 @@ def]
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1915,8 +1924,8 @@ def]
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1926,7 +1935,7 @@ def]
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # first line inserted
   screen-should-contain [
@@ -1936,8 +1945,8 @@ def]
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 1
@@ -1947,7 +1956,7 @@ def]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -1978,18 +1987,19 @@ before <delete-to-end-of-line-end> [
 # undo ctrl-u
 
 scenario editor-can-undo-and-redo-ctrl-u [
+  local-scope
   # create an editor
   assume-screen 10/width, 5/height
-  1:text <- new [abc
+  contents:text <- new [abc
 def]
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor contents, screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # insert some text and hit delete and backspace a few times
   assume-console [
     left-click 1, 2
     press ctrl-u
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .c         .
@@ -1997,8 +2007,8 @@ def]
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 0
@@ -2008,7 +2018,7 @@ def]
     press ctrl-z
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2017,8 +2027,8 @@ def]
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 2
@@ -2028,7 +2038,7 @@ def]
     press ctrl-y
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   # first line inserted
   screen-should-contain [
@@ -2038,8 +2048,8 @@ def]
     .┈┈┈┈┈┈┈┈┈┈.
     .          .
   ]
-  3:num <- get *2:&:editor, cursor-row:offset
-  4:num <- get *2:&:editor, cursor-column:offset
+  3:num/raw <- get *e, cursor-row:offset
+  4:num/raw <- get *e, cursor-column:offset
   memory-should-contain [
     3 <- 1
     4 <- 0
@@ -2049,7 +2059,7 @@ def]
     type [1]
   ]
   run [
-    editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+    editor-event-loop screen:&:screen, console:&:console, e
   ]
   screen-should-contain [
     .          .
@@ -2079,18 +2089,18 @@ before <delete-to-start-of-line-end> [
 ]
 
 scenario editor-can-undo-and-redo-ctrl-u-2 [
+  local-scope
   # create an editor
   assume-screen 10/width, 5/height
-  1:text <- new []
-  2:&:editor <- new-editor 1:text, screen:&:screen, 0/left, 10/right
-  editor-render screen, 2:&:editor
+  e:&:editor <- new-editor [], screen:&:screen, 0/left, 10/right
+  editor-render screen, e
   # insert some text and hit delete and backspace a few times
   assume-console [
     type [abc]
     press ctrl-u
     press ctrl-z
   ]
-  editor-event-loop screen:&:screen, console:&:console, 2:&:editor
+  editor-event-loop screen:&:screen, console:&:console, e
   screen-should-contain [
     .          .
     .abc       .