diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-04 09:40:50 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-04 09:40:50 -0700 |
commit | 363be37f3f41db063ced940e310d6bba6ef82ef3 (patch) | |
tree | 66be4c5a6bf5b07f4fd5ed20eac64c3cfb062bd4 /081run_interactive.cc | |
parent | a1968ebb48c06e1cbc2b813a73e4be235da7b3ee (diff) | |
download | mu-363be37f3f41db063ced940e310d6bba6ef82ef3.tar.gz |
1702 - experiment: start using 'ordinal' in names
It comes up pretty early in the codebase, but hopefully won't come up in the mu level until we get to higher-order recipes. Potentially intimidating name, but such prime real estate with no confusing overloadings in other projects!
Diffstat (limited to '081run_interactive.cc')
-rw-r--r-- | 081run_interactive.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/081run_interactive.cc b/081run_interactive.cc index 95a40533..5f38ad60 100644 --- a/081run_interactive.cc +++ b/081run_interactive.cc @@ -3,7 +3,7 @@ :(before "End Primitive Recipe Declarations") RUN_INTERACTIVE, :(before "End Primitive Recipe Numbers") -Recipe_number["run-interactive"] = RUN_INTERACTIVE; +Recipe_ordinal["run-interactive"] = RUN_INTERACTIVE; //? cerr << "run-interactive: " << RUN_INTERACTIVE << '\n'; //? 1 :(before "End Primitive Recipe Implementations") case RUN_INTERACTIVE: { @@ -35,8 +35,8 @@ void run_interactive(long long int address) { } //? cerr << size << ' ' << Memory[address+size] << '\n'; //? 1 assert(Memory[address+size] == 10); // skip the newline - if (Recipe_number.find("interactive") == Recipe_number.end()) - Recipe_number["interactive"] = Next_recipe_number++; + if (Recipe_ordinal.find("interactive") == Recipe_ordinal.end()) + Recipe_ordinal["interactive"] = Next_recipe_ordinal++; string command = trim(strip_comments(tmp.str())); if (command.empty()) { ++current_step_index(); @@ -48,8 +48,8 @@ void run_interactive(long long int address) { return; } //? exit(0); //? 1 - if (Name[Recipe_number["interactive"]].find(command) != Name[Recipe_number["interactive"]].end()) { - print_value_of_location_as_response(Name[Recipe_number["interactive"]][command]); + if (Name[Recipe_ordinal["interactive"]].find(command) != Name[Recipe_ordinal["interactive"]].end()) { + print_value_of_location_as_response(Name[Recipe_ordinal["interactive"]][command]); ++current_step_index(); return; } @@ -57,15 +57,15 @@ void run_interactive(long long int address) { //? cerr << command; //? 1 //? exit(0); //? 1 //? cerr << "AAA 1\n"; //? 1 - Recipe.erase(Recipe_number["interactive"]); + Recipe.erase(Recipe_ordinal["interactive"]); // call run(string) but without the scheduling //? cerr << ("recipe interactive [\n"+command+"\n]\n"); //? 1 load("recipe interactive [\n"+command+"\n]\n"); transform_all(); -//? cerr << "names: " << Name[Recipe_number["interactive"]].size() << "; "; //? 1 -//? cerr << "steps: " << Recipe[Recipe_number["interactive"]].steps.size() << "; "; //? 1 -//? cerr << "interactive transformed_until: " << Recipe[Recipe_number["interactive"]].transformed_until << '\n'; //? 1 - Current_routine->calls.push_front(call(Recipe_number["interactive"])); +//? cerr << "names: " << Name[Recipe_ordinal["interactive"]].size() << "; "; //? 1 +//? cerr << "steps: " << Recipe[Recipe_ordinal["interactive"]].steps.size() << "; "; //? 1 +//? cerr << "interactive transformed_until: " << Recipe[Recipe_ordinal["interactive"]].transformed_until << '\n'; //? 1 + Current_routine->calls.push_front(call(Recipe_ordinal["interactive"])); } string strip_comments(string in) { @@ -114,7 +114,7 @@ void print_value_of_location_as_response(long long int address) { :(before "End Primitive Recipe Declarations") _RUN_DEPTH, :(before "End Primitive Recipe Numbers") -Recipe_number["$run-depth"] = _RUN_DEPTH; +Recipe_ordinal["$run-depth"] = _RUN_DEPTH; :(before "End Primitive Recipe Implementations") case _RUN_DEPTH: { cerr << Current_routine->calls.size(); |