about summary refs log tree commit diff stats
path: root/sandbox/006-sandbox-copy.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-17 00:05:38 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-17 00:29:22 -0700
commitdd66068298b0a11f2a1f195376cba98e0c8570b5 (patch)
tree06696728fd65cdf38a2ac571943e130e9d60c333 /sandbox/006-sandbox-copy.mu
parentb89b822439f47a490a1b764e14a1ed1b73059cba (diff)
downloadmu-dd66068298b0a11f2a1f195376cba98e0c8570b5.tar.gz
4261 - start using literals for 'true' and 'false'
They uncovered one bug: in edit/003-shortcuts.mu
  <scroll-down> was returning 0 for an address in one place where I
  thought it was returning 0 for a boolean.

Now we've eliminated this bad interaction between tangling and punning
literals.
Diffstat (limited to 'sandbox/006-sandbox-copy.mu')
-rw-r--r--sandbox/006-sandbox-copy.mu10
1 files changed, 5 insertions, 5 deletions
diff --git a/sandbox/006-sandbox-copy.mu b/sandbox/006-sandbox-copy.mu
index 541618e6..4b7222f3 100644
--- a/sandbox/006-sandbox-copy.mu
+++ b/sandbox/006-sandbox-copy.mu
@@ -154,7 +154,7 @@ def should-attempt-copy? click-row:num, click-column:num, env:&:environment -> r
   load-inputs
   # are we below the sandbox editor?
   click-sandbox-area?:bool <- click-on-sandbox-area? click-row, env
-  return-unless click-sandbox-area?, 0/false
+  return-unless click-sandbox-area?, false
   # narrower, is the click in the columns spanning the 'copy' button?
   first-sandbox:&:editor <- get *env, current-sandbox:offset
   assert first-sandbox, [!!]
@@ -162,7 +162,7 @@ def should-attempt-copy? click-row:num, click-column:num, env:&:environment -> r
   sandbox-right-margin:num <- get *first-sandbox, right:offset
   _, _, copy-button-left:num, copy-button-right:num, _ <- sandbox-menu-columns sandbox-left-margin, sandbox-right-margin
   copy-button-vertical-area?:bool <- within-range? click-column, copy-button-left, copy-button-right
-  return-unless copy-button-vertical-area?, 0/false
+  return-unless copy-button-vertical-area?, false
   # finally, is sandbox editor empty?
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   result <- empty-editor? current-sandbox
@@ -173,8 +173,8 @@ def try-copy-sandbox click-row:num, env:&:environment -> clicked-on-copy-button?
   load-inputs
   # identify the sandbox to copy, if the click was actually on the 'copy' button
   sandbox:&:sandbox <- find-sandbox env, click-row
-  return-unless sandbox, 0/false
-  clicked-on-copy-button? <- copy 1/true
+  return-unless sandbox, false
+  clicked-on-copy-button? <- copy true
   text:text <- get *sandbox, data:offset
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   current-sandbox <- insert-text current-sandbox, text
@@ -201,7 +201,7 @@ def click-on-sandbox-area? click-row:num, env:&:environment -> result:bool [
   local-scope
   load-inputs
   first-sandbox:&:sandbox <- get *env, sandbox:offset
-  return-unless first-sandbox, 0/false
+  return-unless first-sandbox, false
   first-sandbox-begins:num <- get *first-sandbox, starting-row-on-screen:offset
   result <- greater-or-equal click-row, first-sandbox-begins
 ]