From c5ffb6e1cc9c5ff880d037c53b8ebc8562be0008 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 25 May 2015 22:27:19 -0700 Subject: 1459 --- html/036call_ingredient.cc.html | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'html/036call_ingredient.cc.html') diff --git a/html/036call_ingredient.cc.html b/html/036call_ingredient.cc.html index e1ed83f6..1696562c 100644 --- a/html/036call_ingredient.cc.html +++ b/html/036call_ingredient.cc.html @@ -2,7 +2,7 @@ -~/Desktop/s/mu/036call_ingredient.cc +036call_ingredient.cc @@ -41,8 +41,6 @@ recipe f [ 12:number <- next-ingredient 13:number <- add 1:literal, 12:number ] -+run: instruction f/1 -+mem: location 12 is 2 +mem: storing 3 in location 13 :(scenario next_ingredient_missing) @@ -56,16 +54,14 @@ recipe f [ :(before "End call Fields") vector<vector<double> > ingredient_atoms; -index_t next_ingredient_to_process; -:(replace{} "call(recipe_number r)") -call(recipe_number r) :running_recipe(r), running_step_index(0), next_ingredient_to_process(0) {} +long long int next_ingredient_to_process; +:(before "End call Constructor") +next_ingredient_to_process = 0; -:(replace "Current_routine->calls.push_front(call(current_instruction().operation))" following "End Primitive Recipe Implementations") -call callee(current_instruction().operation); -for (size_t i = 0; i < ingredients.size(); ++i) { - callee.ingredient_atoms.push_back(ingredients.at(i)); +:(after "complete_call:") +for (long long int i = 0; i < SIZE(ingredients); ++i) { + Current_routine->calls.front().ingredient_atoms.push_back(ingredients.at(i)); } -Current_routine->calls.push_front(callee); :(before "End Primitive Recipe Declarations") NEXT_INGREDIENT, @@ -74,10 +70,10 @@ Recipe_number["next-ingredient"] = NEXT_ :(before "End Primitive Recipe Implementations") case NEXT_INGREDIENT: { assert(!Current_routine->calls.empty()); - if (Current_routine->calls.front().next_ingredient_to_process < Current_routine->calls.front().ingredient_atoms.size()) { + if (Current_routine->calls.front().next_ingredient_to_process < SIZE(Current_routine->calls.front().ingredient_atoms)) { products.push_back( Current_routine->calls.front().ingredient_atoms.at(Current_routine->calls.front().next_ingredient_to_process)); - assert(products.size() == 1); products.resize(2); // push a new vector + assert(SIZE(products) == 1); products.resize(2); // push a new vector products.at(1).push_back(1); ++Current_routine->calls.front().next_ingredient_to_process; } @@ -132,17 +128,17 @@ Recipe_number["ingredient"] = INGREDIENT :(before "End Primitive Recipe Implementations") case INGREDIENT: { assert(isa_literal(current_instruction().ingredients.at(0))); - assert(ingredients.at(0).size() == 1); // scalar - if (static_cast<index_t>(ingredients.at(0).at(0)) < Current_routine->calls.front().ingredient_atoms.size()) { + assert(scalar(ingredients.at(0))); + if (static_cast<long long int>(ingredients.at(0).at(0)) < SIZE(Current_routine->calls.front().ingredient_atoms)) { Current_routine->calls.front().next_ingredient_to_process = ingredients.at(0).at(0); products.push_back( Current_routine->calls.front().ingredient_atoms.at(Current_routine->calls.front().next_ingredient_to_process)); - assert(products.size() == 1); products.resize(2); // push a new vector + assert(SIZE(products) == 1); products.resize(2); // push a new vector products.at(1).push_back(1); ++Current_routine->calls.front().next_ingredient_to_process; } else { - if (current_instruction().products.size() > 1) { + if (SIZE(current_instruction().products) > 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); -- cgit 1.4.1-2-gfad0