about summary refs log tree commit diff stats
path: root/edit/008-sandbox-test.mu
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 /edit/008-sandbox-test.mu
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 'edit/008-sandbox-test.mu')
-rw-r--r--edit/008-sandbox-test.mu12
1 files changed, 6 insertions, 6 deletions
diff --git a/edit/008-sandbox-test.mu b/edit/008-sandbox-test.mu
index 5fa4c70c..a3311891 100644
--- a/edit/008-sandbox-test.mu
+++ b/edit/008-sandbox-test.mu
@@ -132,7 +132,7 @@ after <global-touch> [
   }
 ]
 
-recipe find-click-in-sandbox-output env:address:shared:programming-environment-data, click-row:number -> sandbox:address:shared:sandbox-data [
+def find-click-in-sandbox-output env:address:shared:programming-environment-data, click-row:number -> sandbox:address:shared:sandbox-data [
   local-scope
   load-ingredients
   # assert click-row >= sandbox.starting-row-on-screen
@@ -152,13 +152,13 @@ recipe find-click-in-sandbox-output env:address:shared:programming-environment-d
   }
   # return sandbox if click is in its output region
   response-starting-row:number <- get *sandbox, response-starting-row-on-screen:offset
-  reply-unless response-starting-row, 0/no-click-in-sandbox-output
+  return-unless response-starting-row, 0/no-click-in-sandbox-output
   click-in-response?:boolean <- greater-or-equal click-row, response-starting-row
-  reply-unless click-in-response?, 0/no-click-in-sandbox-output
-  reply sandbox
+  return-unless click-in-response?, 0/no-click-in-sandbox-output
+  return sandbox
 ]
 
-recipe toggle-expected-response sandbox:address:shared:sandbox-data -> sandbox:address:shared:sandbox-data [
+def toggle-expected-response sandbox:address:shared:sandbox-data -> sandbox:address:shared:sandbox-data [
   local-scope
   load-ingredients
   expected-response:address:address:shared:array:character <- get-address *sandbox, expected-response:offset
@@ -166,7 +166,7 @@ recipe toggle-expected-response sandbox:address:shared:sandbox-data -> sandbox:a
     # if expected-response is set, reset
     break-unless *expected-response
     *expected-response <- copy 0
-    reply sandbox/same-as-ingredient:0
+    return sandbox/same-as-ingredient:0
   }
   # if not, current response is the expected response
   response:address:shared:array:character <- get *sandbox, response:offset