diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-01-21 13:51:50 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-01-22 08:52:28 -0800 |
commit | 3151fb2387439475e12a354f2905a77ccb80ca19 (patch) | |
tree | ac9d527f475ea677e3fab90b7c1c0cdcf1e2b7ca /edit | |
parent | b35cdb494562feabc600a6eac2913385e507f455 (diff) | |
download | mu-3151fb2387439475e12a354f2905a77ccb80ca19.tar.gz |
2585 - label sandboxes with a number
It also seems useful that the number maps to the name of the file the sandbox is saved in. However this mapping is currently a happy accident and not actually tested. I'm starting to switch gears and help make the editor useable with many many sandboxes. This is just the first step of several.
Diffstat (limited to 'edit')
-rw-r--r-- | edit/005-sandbox.mu | 27 | ||||
-rw-r--r-- | edit/006-sandbox-edit.mu | 4 | ||||
-rw-r--r-- | edit/007-sandbox-delete.mu | 6 | ||||
-rw-r--r-- | edit/008-sandbox-test.mu | 4 | ||||
-rw-r--r-- | edit/009-sandbox-trace.mu | 10 | ||||
-rw-r--r-- | edit/010-warnings.mu | 16 |
6 files changed, 38 insertions, 29 deletions
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index 3095e865..6b442a91 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -53,7 +53,7 @@ scenario run-and-show-results [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊divide-with-remainder 11, 3 . . ┊3 . . ┊2 . @@ -82,6 +82,13 @@ scenario run-and-show-results [ . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. . ┊ . ] + # sandbox title in reverse video + screen-should-contain-in-color 0/black, [ + . . + . . + . . + . 0 . + ] # run another command assume-console [ left-click 1, 80 @@ -96,11 +103,11 @@ scenario run-and-show-results [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊add 2, 2 . . ┊4 . . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊1 x. . ┊divide-with-remainder 11, 3 . . ┊3 . . ┊2 . @@ -237,11 +244,11 @@ recipe! render-sandbox-side screen:address:shared:screen, env:address:shared:pro row <- add row, 1 draw-horizontal screen, row, left, right, 9473/horizontal-double sandbox:address:shared:sandbox-data <- get *env, sandbox:offset - row, screen <- render-sandboxes screen, sandbox, left, right, row + row, screen <- render-sandboxes screen, sandbox, left, right, row, 0 clear-rest-of-screen screen, row, left, left, right ] -recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [ +recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number, idx:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [ local-scope load-ingredients #? $log [render sandbox] @@ -252,6 +259,7 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san # render sandbox menu row <- add row, 1 screen <- move-cursor screen, row, left + print screen, idx, 0/black, 245/grey clear-line-delimited screen, left, right delete-icon:character <- copy 120/x print screen, delete-icon, 245/grey @@ -288,7 +296,8 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san draw-horizontal screen, row, left, right, 9473/horizontal-double # draw next sandbox next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset - row, screen <- render-sandboxes screen, next-sandbox, left, right, row + next-idx:number <- add idx, 1 + row, screen <- render-sandboxes screen, next-sandbox, left, right, row, next-idx ] # assumes programming environment has no sandboxes; restores them from previous session @@ -411,7 +420,7 @@ reply z . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .z:number <- add 2, 2 ┊ x. + .z:number <- add 2, 2 ┊0 x. .reply z ┊foo . .] ┊4 . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -432,7 +441,7 @@ reply z . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .z:number <- add 2, 3 ┊ x. + .z:number <- add 2, 3 ┊0 x. .reply z ┊foo . .] ┊5 . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -460,7 +469,7 @@ scenario run-instruction-manages-screen-per-sandbox [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊print-integer screen, 4 . . ┊screen: . . ┊ .4 . . diff --git a/edit/006-sandbox-edit.mu b/edit/006-sandbox-edit.mu index 80ceb2b9..db4dd2a8 100644 --- a/edit/006-sandbox-edit.mu +++ b/edit/006-sandbox-edit.mu @@ -19,7 +19,7 @@ recipe foo [ . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . reply 4 ┊ x. + . reply 4 ┊0 x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . . ┊━━━━━━━━━━━━━━━━━━━. @@ -140,7 +140,7 @@ scenario sandbox-with-print-can-be-edited [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊print-integer screen, 4 . . ┊screen: . . ┊ .4 . . diff --git a/edit/007-sandbox-delete.mu b/edit/007-sandbox-delete.mu index 95b6042f..3cbe7d5d 100644 --- a/edit/007-sandbox-delete.mu +++ b/edit/007-sandbox-delete.mu @@ -19,11 +19,11 @@ scenario deleting-sandboxes [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊add 2, 2 . . ┊4 . . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊1 x. . ┊divide-with-remainder 11, 3 . . ┊3 . . ┊2 . @@ -41,7 +41,7 @@ scenario deleting-sandboxes [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊add 2, 2 . . ┊4 . . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. diff --git a/edit/008-sandbox-test.mu b/edit/008-sandbox-test.mu index b15eb37e..b525cfd1 100644 --- a/edit/008-sandbox-test.mu +++ b/edit/008-sandbox-test.mu @@ -19,7 +19,7 @@ recipe foo [ . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . reply 4 ┊ x. + . reply 4 ┊0 x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . . ┊━━━━━━━━━━━━━━━━━━━. @@ -52,7 +52,7 @@ recipe foo [ . run (F4) . .␣ ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . reply 4 ┊ x. + . reply 4 ┊0 x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . . ┊━━━━━━━━━━━━━━━━━━━. diff --git a/edit/009-sandbox-trace.mu b/edit/009-sandbox-trace.mu index 92d46bc0..ddf3dbf5 100644 --- a/edit/009-sandbox-trace.mu +++ b/edit/009-sandbox-trace.mu @@ -19,7 +19,7 @@ recipe foo [ . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . stash [abc] ┊ x. + . stash [abc] ┊0 x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━. . ┊ . @@ -38,7 +38,7 @@ recipe foo [ . run (F4) . .␣ ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . stash [abc] ┊ x. + . stash [abc] ┊0 x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊abc . . ┊━━━━━━━━━━━━━━━━━━━. @@ -67,7 +67,7 @@ recipe foo [ . run (F4) . .␣ ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . stash [abc] ┊ x. + . stash [abc] ┊0 x. .] ┊foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━. . ┊ . @@ -94,7 +94,7 @@ recipe foo [ . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . stash [abc] ┊ x. + . stash [abc] ┊0 x. . reply 4 ┊foo . .] ┊4 . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━. @@ -112,7 +112,7 @@ recipe foo [ . run (F4) . . ┊ . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. - . stash [abc] ┊ x. + . stash [abc] ┊0 x. . reply 4 ┊foo . .] ┊abc . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . diff --git a/edit/010-warnings.mu b/edit/010-warnings.mu index 61cac2d2..313de970 100644 --- a/edit/010-warnings.mu +++ b/edit/010-warnings.mu @@ -144,7 +144,7 @@ scenario run-hides-warnings-from-past-sandboxes [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊add 2, 2 . . ┊4 . . ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -173,7 +173,7 @@ z <- add x, [a] . run (F4) . .recipe foo x:_elem -> z:_elem [ ┊ . .local-scope ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .load-ingredients ┊ x. + .load-ingredients ┊0 x. .z <- add x, [a] ┊foo 2 . .] ┊foo_2: 'add' requires number ingredients, but go↩. .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊t [a] . @@ -192,7 +192,7 @@ z <- add x, [a] . run (F4) . .recipe foo x:_elem -> z:_elem [ ┊ . .local-scope ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .load-ingredients ┊ x. + .load-ingredients ┊0 x. .z <- add x, [a] ┊foo 2 . .] ┊foo_2: 'add' requires number ingredients, but go↩. .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊t [a] . @@ -444,7 +444,7 @@ scenario run-instruction-and-print-warnings [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊get 1234:number, foo:offset . . ┊unknown element foo in container number . . ┊first ingredient of 'get' should be a container,↩. @@ -508,7 +508,7 @@ scenario run-instruction-and-print-warnings-only-once [ . run (F4) . . ┊ . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . ┊ x. + . ┊0 x. . ┊get 1234:number, foo:offset . . ┊unknown element foo in container number . . ┊first ingredient of 'get' should be a container,↩. @@ -541,7 +541,7 @@ scenario sandbox-can-handle-infinite-loop [ . run (F4) . .recipe foo [ ┊ . . { ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - . loop ┊ x. + . loop ┊0 x. . } ┊foo . .] ┊took too long! . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. @@ -573,7 +573,7 @@ reply b . run (F4) . .recipe foo [ ┊ . .local-scope ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .a:number <- next-ingredient ┊ x. + .a:number <- next-ingredient ┊0 x. .b:number <- next-ingredient ┊foo 4, 0 . .stash [dividing by], b ┊foo: divide by zero in '_, c:number <- divide-wi↩. ._, c:number <- divide-with-remainder a, b ┊th-remainder a, b' . @@ -592,7 +592,7 @@ reply b . run (F4) . .recipe foo [ ┊ . .local-scope ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. - .a:number <- next-ingredient ┊ x. + .a:number <- next-ingredient ┊0 x. .b:number <- next-ingredient ┊foo 4, 0 . .stash [dividing by], b ┊dividing by 0 . ._, c:number <- divide-with-remainder a, b ┊foo: divide by zero in '_, c:number <- divide-wi↩. |