diff options
-rw-r--r-- | 038scheduler.cc | 13 | ||||
-rw-r--r-- | 043new.cc | 11 |
2 files changed, 14 insertions, 10 deletions
diff --git a/038scheduler.cc b/038scheduler.cc index ef0b335a..9bda9de9 100644 --- a/038scheduler.cc +++ b/038scheduler.cc @@ -113,16 +113,9 @@ Current_routine = NULL; void run_main(int argc, char* argv[]) { recipe_ordinal r = Recipe_ordinal[string("main")]; if (r) { - // pass in commandline args as ingredients to main - // todo: test this - routine* rr = new routine(r); - Current_routine = rr; - for (long long int i = 1; i < argc; ++i) { - vector<double> arg; - arg.push_back(new_mu_string(argv[i])); - Current_routine->calls.front().ingredient_atoms.push_back(arg); - } - run(rr); + routine* main_routine = new routine(r); + // Update main_routine + run(main_routine); } } diff --git a/043new.cc b/043new.cc index 2594dc5d..817eee53 100644 --- a/043new.cc +++ b/043new.cc @@ -348,6 +348,17 @@ long long int new_mu_string(const string& contents) { return result; } +//: pass in commandline args as ingredients to main +//: todo: test this + +:(after "Update main_routine") +Current_routine = main_routine; +for (long long int i = 1; i < argc; ++i) { + vector<double> arg; + arg.push_back(new_mu_string(argv[i])); + Current_routine->calls.front().ingredient_atoms.push_back(arg); +} + //: stash recognizes strings :(scenario stash_string) |