about summary refs log tree commit diff stats
path: root/edit/005-sandbox.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-09-05 12:17:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-09-05 12:17:27 -0700
commitae244ebddc9f0c2952b2d79b3d6203f4431f9f53 (patch)
tree851874353edd9e5d8209f347d8d32c2fc8102dbf /edit/005-sandbox.mu
parenta90faae99043042ec5e2d0de21b7dbe0eba29e3a (diff)
downloadmu-ae244ebddc9f0c2952b2d79b3d6203f4431f9f53.tar.gz
2157 - edit/ now contains real layers
To run just until say layer 6, say this:

  $ ./mu test edit/00[0-6]*

The layers are not perfect yet; there might be a few things (like the
warning fields) that need to move to a later layer.
Diffstat (limited to 'edit/005-sandbox.mu')
-rw-r--r--edit/005-sandbox.mu56
1 files changed, 9 insertions, 47 deletions
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 239112ce..10a3fffb 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -1,4 +1,12 @@
 ## running code from the editor and creating sandboxes
+#
+# Running code in the sandbox editor prepends its contents to a list of
+# (non-editable) sandboxes below the editor, showing the result and a maybe
+# few other things.
+
+container programming-environment-data [
+  sandbox:address:sandbox-data  # list of sandboxes, from top to bottom
+]
 
 container sandbox-data [
   data:address:array:character
@@ -211,7 +219,7 @@ recipe save-sandboxes [
   }
 ]
 
-recipe render-sandbox-side [
+recipe! render-sandbox-side [
   local-scope
   screen:address <- next-ingredient
   env:address:programming-environment-data <- next-ingredient
@@ -567,52 +575,6 @@ scenario run-instruction-manages-screen-per-sandbox [
   ]
 ]
 
-scenario sandbox-with-print-can-be-edited [
-  $close-trace  # trace too long
-  assume-screen 100/width, 20/height
-  # left editor is empty
-  1:address:array:character <- new []
-  # right editor contains an instruction
-  2:address:array:character <- new [print-integer screen:address, 4]
-  3:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character, 2:address:array:character
-  # run the sandbox
-  assume-console [
-    press F4
-  ]
-  run [
-    event-loop screen:address, console:address, 3:address:programming-environment-data
-  ]
-  screen-should-contain [
-    .                                                                                 run (F4)           .
-    .                                                  ┊                                                 .
-    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                x.
-    .                                                  ┊print-integer screen:address, 4                  .
-    .                                                  ┊screen:                                          .
-    .                                                  ┊  .4                             .               .
-    .                                                  ┊  .                              .               .
-    .                                                  ┊  .                              .               .
-    .                                                  ┊  .                              .               .
-    .                                                  ┊  .                              .               .
-    .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                 .
-  ]
-  # edit the sandbox
-  assume-console [
-    left-click 3, 70
-  ]
-  run [
-    event-loop screen:address, console:address, 3:address:programming-environment-data
-  ]
-  screen-should-contain [
-    .                                                                                 run (F4)           .
-    .                                                  ┊print-integer screen:address, 4                  .
-    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .                                                  ┊                                                 .
-    .                                                  ┊                                                 .
-  ]
-]
-
 scenario sandbox-can-handle-infinite-loop [
   $close-trace  # trace too long
   assume-screen 100/width, 20/height