about summary refs log tree commit diff stats
path: root/049continuation.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-24 15:45:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-24 15:45:09 -0700
commit012d2ee18de5daa3c08efea9fc30c89d474e77c1 (patch)
treed025a7edbf6e815e0b72e371a459c185e8f9a235 /049continuation.cc
parent8156110ea633b7375096ab98be85254f00f6b0b2 (diff)
downloadmu-012d2ee18de5daa3c08efea9fc30c89d474e77c1.tar.gz
1451 - share post-processing between all call instructions
Diffstat (limited to '049continuation.cc')
-rw-r--r--049continuation.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/049continuation.cc b/049continuation.cc
index 5ab2c233..b06abb98 100644
--- a/049continuation.cc
+++ b/049continuation.cc
@@ -209,18 +209,11 @@ CALL_DELIMITED_CONTINUATION,
 Recipe_number["call-delimited-continuation"] = CALL_DELIMITED_CONTINUATION;
 :(before "End Primitive Recipe Implementations")
 case CALL_DELIMITED_CONTINUATION: {
-  ++Callstack_depth;
-  assert(Callstack_depth < 9000);  // 9998-101 plus cushion
   assert(scalar(ingredients.at(0)));
   assert(Delimited_continuation.find(ingredients.at(0).at(0)) != Delimited_continuation.end());
   const call_stack& new_calls = Delimited_continuation[ingredients.at(0).at(0)];
-  for (call_stack::const_reverse_iterator p = new_calls.rbegin(); p != new_calls.rend(); ++p) {
-//?     cerr << "copying back " << Recipe[p->running_recipe].name << '\n'; //? 1
+  for (call_stack::const_reverse_iterator p = new_calls.rbegin(); p != new_calls.rend(); ++p)
     Current_routine->calls.push_front(*p);
-  }
-  for (long long int i = /*skip continuation*/1; i < SIZE(ingredients); ++i) {
-//?     cerr << "copying ingredient " << i << ": " << ingredients.at(i).at(0) << '\n'; //? 1
-    Current_routine->calls.front().ingredient_atoms.push_back(ingredients.at(i));
-  }
-  continue;  // not done with caller; don't increment current_step_index()
+  ingredients.erase(ingredients.begin());  // drop the function
+  goto complete_call;
 }