about summary refs log tree commit diff stats
path: root/076stream.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 /076stream.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 '076stream.mu')
-rw-r--r--076stream.mu8
1 files changed, 4 insertions, 4 deletions
diff --git a/076stream.mu b/076stream.mu
index aa11b773..c3af2ddf 100644
--- a/076stream.mu
+++ b/076stream.mu
@@ -4,7 +4,7 @@ container stream [
   data:address:shared:array:character
 ]
 
-recipe new-stream s:address:shared:array:character -> result:address:shared:stream [
+def new-stream s:address:shared:array:character -> result:address:shared:stream [
   local-scope
   load-ingredients
   result <- new stream:type
@@ -14,14 +14,14 @@ recipe new-stream s:address:shared:array:character -> result:address:shared:stre
   *d <- copy s
 ]
 
-recipe rewind-stream in:address:shared:stream -> in:address:shared:stream [
+def rewind-stream in:address:shared:stream -> in:address:shared:stream [
   local-scope
   load-ingredients
   x:address:number <- get-address *in, index:offset
   *x <- copy 0
 ]
 
-recipe read-line in:address:shared:stream -> result:address:shared:array:character, in:address:shared:stream [
+def read-line in:address:shared:stream -> result:address:shared:array:character, in:address:shared:stream [
   local-scope
   load-ingredients
   idx:address:number <- get-address *in, index:offset
@@ -31,7 +31,7 @@ recipe read-line in:address:shared:stream -> result:address:shared:array:charact
   *idx <- add next-idx, 1  # skip newline
 ]
 
-recipe end-of-stream? in:address:shared:stream -> result:boolean [
+def end-of-stream? in:address:shared:stream -> result:boolean [
   local-scope
   load-ingredients
   idx:number <- get *in, index:offset