From 2199940af170456929a3c4fe4d07d25afea6ae55 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Apr 2015 11:22:59 -0700 Subject: 1077 --- cpp/020run | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'cpp/020run') diff --git a/cpp/020run b/cpp/020run index 91e242a7..1de1c6ae 100644 --- a/cpp/020run +++ b/cpp/020run @@ -1,3 +1,14 @@ +//: Once a recipe is loaded, we need to run it. +//: +//: 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 +//: 'primitive' recipes. That will then give the ability to run recipes +//: containing these primitives. +//: +//: This layer defines a skeleton with just two primitive recipes: IDLE which +//: does nothing, and COPY, which can copy numbers from one memory location to +//: another. Later layers will add more primitives. + :(scenarios run) :(scenario copy_literal) recipe main [ @@ -66,6 +77,7 @@ void run(routine rr) { //: Some helpers. //: We'll need to override these later as we change the definition of routine. //: Important that they return referrences into the routine. + inline size_t& running_at(routine& rr) { return rr.running_at; } @@ -115,9 +127,8 @@ void load(string filename) { load("core.mu"); recently_added_recipes.clear(); // freeze everything so it doesn't get cleared by tests -//: helper for tests - :(code) +// helper for tests void run(string form) { vector tmp = add_recipes(form); transform_all(); -- cgit 1.4.1-2-gfad0