From 8c9e97ae0183e79accbcb1afc57499f83c0b5406 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 24 Apr 2015 00:28:24 -0700 Subject: 1155 - three phases of mu: load, transform, run Each phase implicitly calls previous phases. Most C++ scenarios implicitly call one, two or three of the phases. More clear now that 'load' does more than just add recipes. --- cpp/020run | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cpp/020run') diff --git a/cpp/020run b/cpp/020run index 3e993f95..a9afb460 100644 --- a/cpp/020run +++ b/cpp/020run @@ -1,4 +1,4 @@ -//: Once a recipe is loaded, we need to run it. +//: Phase 3: Start running a loaded and transformed recipe. //: //: So far we've seen recipes as lists of instructions, and instructions point //: at other recipes. To kick things off mu needs to know how to run certain @@ -101,7 +101,7 @@ inline bool done(routine& rr) { :(before "End Commandline Parsing") if (argc > 1) { for (int i = 1; i < argc; ++i) { - load(argv[i]); + load_and_transform(argv[i]); } } @@ -118,14 +118,14 @@ if (!Run_tests) { } :(code) -void load(string filename) { +void load_and_transform(string filename) { ifstream fin(filename.c_str()); if (!fin) { raise << "no such file " << filename << '\n'; return; } fin >> std::noskipws; - add_recipes(fin); + load(fin); transform_all(); fin.close(); // freeze everything so it doesn't get cleared by tests @@ -135,12 +135,12 @@ void load(string filename) { //:: On startup, load everything in core.mu :(before "End Load Recipes") -load("core.mu"); +load_and_transform("core.mu"); :(code) // helper for tests void run(string form) { - vector tmp = add_recipes(form); + vector tmp = load(form); transform_all(); run(tmp.front()); } -- cgit 1.4.1-2-gfad0