about summary refs log tree commit diff stats
path: root/cpp/033length
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-24 20:07:17 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-24 20:16:21 -0700
commitdcfca05e08744270b3145f7906c5cd46485a4b52 (patch)
tree673e8715688bdc3990bbfe9077158e764690ec01 /cpp/033length
parent69e14325e3eaa3722766bb9706d7da5862b6ea26 (diff)
downloadmu-dcfca05e08744270b3145f7906c5cd46485a4b52.tar.gz
1171
Chip away at eliminating that 'pc' reference by first throwing out the
most common expression that uses it: instructions[pc].
Diffstat (limited to 'cpp/033length')
-rw-r--r--cpp/033length4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpp/033length b/cpp/033length
index 01199ce6..5281287d 100644
--- a/cpp/033length
+++ b/cpp/033length
@@ -17,7 +17,7 @@ LENGTH,
 Recipe_number["length"] = LENGTH;
 :(before "End Primitive Recipe Implementations")
 case LENGTH: {
-  reagent x = canonize(instructions[pc].ingredients[0]);
+  reagent x = canonize(current_instruction().ingredients[0]);
   if (x.types[0] != Type_number["array"]) {
     raise << "tried to calculate length of non-array " << x.to_string() << '\n';
     break;
@@ -25,6 +25,6 @@ case LENGTH: {
   vector<int> result;
 //?   cout << "length: " << x.value << '\n'; //? 1
   result.push_back(Memory[x.value]);
-  write_memory(instructions[pc].products[0], result);
+  write_memory(current_instruction().products[0], result);
   break;
 }