about summary refs log tree commit diff stats
path: root/cpp/013run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-26 17:03:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-26 17:03:07 -0700
commitc82d01762778baeb71c26365479e3c1cddcfbf13 (patch)
tree846100fbc599414b520d5049ffa14182318a5451 /cpp/013run
parentc63e2811a14344801950d075ca89c3601e73f065 (diff)
downloadmu-c82d01762778baeb71c26365479e3c1cddcfbf13.tar.gz
973
Diffstat (limited to 'cpp/013run')
-rw-r--r--cpp/013run7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/013run b/cpp/013run
index 5173f6f3..33385e00 100644
--- a/cpp/013run
+++ b/cpp/013run
@@ -118,9 +118,8 @@ recipes_added_by_test.clear();
 //: beware: overridden in later layers
 vector<int> read_memory(reagent x) {
 //?   cout << "read_memory: " << x.to_string() << '\n'; //? 1
-  static const int LITERAL = Type_number["literal"];
   vector<int> result;
-  if (x.types[0] == LITERAL) {
+  if (isa_literal(x)) {
     result.push_back(x.value);
     return result;
   }
@@ -157,6 +156,10 @@ bool is_dummy(const reagent& x) {
   return x.name == "_";
 }
 
+bool isa_literal(const reagent& r) {
+  return r.types.size() == 1 && r.types[0] == 0;
+}
+
 :(scenario run_label)
 recipe main [
   +foo