diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-28 18:19:41 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-28 18:26:05 -0700 |
commit | 70f70118f468b51ac14b7e992b0ec941c3a50d4d (patch) | |
tree | 07749a54af09d9bfbeb93b7b52dc4a175ed6a886 /052tangle.cc | |
parent | b69daf785df8dee56f851ce9d6dd38d7779a04ca (diff) | |
download | mu-70f70118f468b51ac14b7e992b0ec941c3a50d4d.tar.gz |
2306 - recipe headers
Once a student has gotten used to recipes and ingredients using the staged 'next-ingredient' approach there's no reason to avoid conventional function headers. As an added bonus we can now: a) check that all 'reply' instructions in a recipe are consistent b) deduce what to reply without needing to say so everytime c) start thinking about type parameters for recipes (generic functions!)
Diffstat (limited to '052tangle.cc')
-rw-r--r-- | 052tangle.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/052tangle.cc b/052tangle.cc index 2c393a31..7995e501 100644 --- a/052tangle.cc +++ b/052tangle.cc @@ -35,7 +35,8 @@ Fragments_used.clear(); :(before "End Command Handlers") else if (command == "before") { string label = next_word(in); - recipe tmp = slurp_body(in); + recipe tmp; + slurp_body(in, tmp); if (is_waypoint(label)) Before_fragments[label].steps.insert(Before_fragments[label].steps.end(), tmp.steps.begin(), tmp.steps.end()); else @@ -43,7 +44,8 @@ else if (command == "before") { } else if (command == "after") { string label = next_word(in); - recipe tmp = slurp_body(in); + recipe tmp; + slurp_body(in, tmp); if (is_waypoint(label)) After_fragments[label].steps.insert(After_fragments[label].steps.begin(), tmp.steps.begin(), tmp.steps.end()); else |