about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-09-15 00:22:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-09-15 00:22:21 -0700
commit8bc3489f8f3ed5d0d8a19cadbba3cd81be7c4f1a (patch)
tree4b7ee6216afcb8ea5860cdb6f7430bb7795abb0f
parent4082acd24f0049604f840fb5e60977e247aafbdf (diff)
downloadmu-8bc3489f8f3ed5d0d8a19cadbba3cd81be7c4f1a.tar.gz
2200
-rw-r--r--038scheduler.cc13
-rw-r--r--043new.cc11
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)