about summary refs log tree commit diff stats
path: root/041jump_target.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-03-08 01:30:14 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-03-08 01:46:47 -0800
commit1ead356219bb2eb59487d1012f837bd07ec336f5 (patch)
treeaf15f390b81e4d6b3e0940c5756a0d7fd1060bb5 /041jump_target.cc
parent27ba0937a3747684f299bb7a8b3cdd0fbb689db3 (diff)
downloadmu-1ead356219bb2eb59487d1012f837bd07ec336f5.tar.gz
2735 - define recipes using 'def'
I'm dropping all mention of 'recipe' terminology from the Readme. That
way I hope to avoid further bike-shedding discussions while I very
slowly decide on the right terminology with my students.

I could be smarter in my error messages and use 'recipe' when code uses
it and 'function' otherwise. But what about other words like ingredient?
It would all add complexity that I'm not yet sure is worthwhile. But I
do want separate experiences for veteran programmers reading about Mu on
github and for people learning programming using Mu.
Diffstat (limited to '041jump_target.cc')
-rw-r--r--041jump_target.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/041jump_target.cc b/041jump_target.cc
index 36d43df9..f58ff3d1 100644
--- a/041jump_target.cc
+++ b/041jump_target.cc
@@ -8,7 +8,7 @@
 //: iteration of some containing loop nest.
 
 :(scenario jump_to_label)
-recipe main [
+def main [
   jump +target:label
   1:number <- copy 0
   +target
@@ -92,7 +92,7 @@ bool is_jump_target(string label) {
 }
 
 :(scenario break_to_label)
-recipe main [
+def main [
   {
     {
       break +target:label
@@ -104,7 +104,7 @@ recipe main [
 -mem: storing 0 in location 1
 
 :(scenario jump_if_to_label)
-recipe main [
+def main [
   {
     {
       jump-if 1, +target:label
@@ -116,7 +116,7 @@ recipe main [
 -mem: storing 0 in location 1
 
 :(scenario loop_unless_to_label)
-recipe main [
+def main [
   {
     {
       loop-unless 0, +target:label  # loop/break with a label don't care about braces
@@ -128,7 +128,7 @@ recipe main [
 -mem: storing 0 in location 1
 
 :(scenario jump_runs_code_after_label)
-recipe main [
+def main [
   # first a few lines of padding to exercise the offset computation
   1:number <- copy 0
   2:number <- copy 0
@@ -143,21 +143,21 @@ recipe main [
 
 :(scenario jump_fails_without_target)
 % Hide_errors = true;
-recipe main [
+def main [
   jump
 ]
 +error: main: 'jump' expects an ingredient but got none
 
 :(scenario jump_fails_without_target_2)
 % Hide_errors = true;
-recipe main [
+def main [
   jump-if 1/true
 ]
 +error: main: 'jump-if' expects 2 ingredients but got 1
 
 :(scenario recipe_fails_on_duplicate_jump_target)
 % Hide_errors = true;
-recipe main [
+def main [
   +label
   1:number <- copy 0
   +label
@@ -167,7 +167,7 @@ recipe main [
 
 :(scenario jump_ignores_nontarget_label)
 % Hide_errors = true;
-recipe main [
+def main [
   # first a few lines of padding to exercise the offset computation
   1:number <- copy 0
   2:number <- copy 0