about summary refs log tree commit diff stats
path: root/036call_ingredient.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-12 13:10:23 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-12 17:00:19 -0700
commit3663ca6c2d4c42c4a7bf6af4b2edf71dd8d10dd7 (patch)
tree330d04974b9d30bff1b16adc8d14a3d9fd77643d /036call_ingredient.cc
parenta70d593dfb8eea87a898a69adeb9689a21199edf (diff)
downloadmu-3663ca6c2d4c42c4a7bf6af4b2edf71dd8d10dd7.tar.gz
1356 - snapshot #2: floating point support
I added one test to check that divide can return a float, then hacked at
the rippling failures across the entire entire codebase until all tests
pass. Now I need to look at the changes I made and see if there's a
system to them, identify other places that I missed, and figure out the
best way to cover all cases. I also need to show real rather than
encoded values in the traces, but I can't use value() inside reagent
methods because of the name clash with the member variable. So let's
take a snapshot before we attempt any refactoring. This was non-trivial
to get right.

Even if I convince myself that I've gotten it right, I might back this
all out if I can't easily *persuade others* that I've gotten it right.
Diffstat (limited to '036call_ingredient.cc')
-rw-r--r--036call_ingredient.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/036call_ingredient.cc b/036call_ingredient.cc
index 5c321ef9..f5964e4b 100644
--- a/036call_ingredient.cc
+++ b/036call_ingredient.cc
@@ -105,14 +105,14 @@ case INGREDIENT: {
     products.push_back(
         Current_routine->calls.top().ingredient_atoms.at(Current_routine->calls.top().next_ingredient_to_process));
     assert(products.size() == 1);  products.resize(2);  // push a new vector
-    products.at(1).push_back(1);
+    products.at(1).push_back(1);  // non-negative integer
     ++Current_routine->calls.top().next_ingredient_to_process;
   }
   else {
     if (current_instruction().products.size() > 1) {
       products.resize(2);
       products.at(0).push_back(0);  // todo: will fail noisily if we try to read a compound value
-      products.at(1).push_back(0);
+      products.at(1).push_back(0);  // non-negative integer
     }
   }
   break;