about summary refs log tree commit diff stats
path: root/024boolean.cc
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 /024boolean.cc
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 '024boolean.cc')
-rw-r--r--024boolean.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/024boolean.cc b/024boolean.cc
index 3d51fd7a..114d9d8e 100644
--- a/024boolean.cc
+++ b/024boolean.cc
@@ -34,27 +34,27 @@ case AND: {
 
 :(scenario and)
 def main [
-  1:bool <- copy 1
-  2:bool <- copy 0
+  1:bool <- copy true
+  2:bool <- copy false
   3:bool <- and 1:bool, 2:bool
 ]
 +mem: storing 0 in location 3
 
 :(scenario and_2)
 def main [
-  1:bool <- and 1, 1
+  1:bool <- and true, true
 ]
 +mem: storing 1 in location 1
 
 :(scenario and_multiple)
 def main [
-  1:bool <- and 1, 1, 0
+  1:bool <- and true, true, false
 ]
 +mem: storing 0 in location 1
 
 :(scenario and_multiple_2)
 def main [
-  1:bool <- and 1, 1, 1
+  1:bool <- and true, true, true
 ]
 +mem: storing 1 in location 1
 
@@ -92,27 +92,27 @@ case OR: {
 
 :(scenario or)
 def main [
-  1:bool <- copy 1
-  2:bool <- copy 0
+  1:bool <- copy true
+  2:bool <- copy false
   3:bool <- or 1:bool, 2:bool
 ]
 +mem: storing 1 in location 3
 
 :(scenario or_2)
 def main [
-  1:bool <- or 0, 0
+  1:bool <- or false, false
 ]
 +mem: storing 0 in location 1
 
 :(scenario or_multiple)
 def main [
-  1:bool <- and 0, 0, 0
+  1:bool <- or false, false, false
 ]
 +mem: storing 0 in location 1
 
 :(scenario or_multiple_2)
 def main [
-  1:bool <- or 0, 0, 1
+  1:bool <- or false, false, true
 ]
 +mem: storing 1 in location 1
 
@@ -152,14 +152,14 @@ case NOT: {
 
 :(scenario not)
 def main [
-  1:bool <- copy 1
+  1:bool <- copy true
   2:bool <- not 1:bool
 ]
 +mem: storing 0 in location 2
 
 :(scenario not_multiple)
 def main [
-  1:bool, 2:bool, 3:bool <- not 1, 0, 1
+  1:bool, 2:bool, 3:bool <- not true, false, true
 ]
 +mem: storing 0 in location 1
 +mem: storing 1 in location 2