diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-13 10:03:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-13 10:03:26 -0700 |
commit | 5497090aa1e708c22cd240913a53dda32bb067aa (patch) | |
tree | 5a9eb76d447736a8199230c9386bd0a374b325dd /channel.mu | |
parent | 01caf342d072115c27926b1a61c2fc75ab9fbee0 (diff) | |
download | mu-5497090aa1e708c22cd240913a53dda32bb067aa.tar.gz |
1363 - rename 'integer' to 'number'
..now that we support non-integers.
Diffstat (limited to 'channel.mu')
-rw-r--r-- | channel.mu | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/channel.mu b/channel.mu index 0206c2f9..86378352 100644 --- a/channel.mu +++ b/channel.mu @@ -5,15 +5,15 @@ recipe producer [ default-space:address:array:location <- new location:type, 30:literal chan:address:channel <- next-ingredient # n = 0 - n:integer <- copy 0:literal + n:number <- copy 0:literal { - done?:boolean <- lesser-than n:integer, 5:literal + done?:boolean <- lesser-than n:number, 5:literal break-unless done?:boolean # other threads might get between these prints - $print [produce: ], n:integer, [ + $print [produce: ], n:number, [ ] - chan:address:channel <- write chan:address:channel, n:integer - n:integer <- add n:integer, 1:literal + chan:address:channel <- write chan:address:channel, n:number + n:number <- add n:number, 1:literal loop } ] @@ -24,9 +24,9 @@ recipe consumer [ chan:address:channel <- next-ingredient { # read an integer from the channel - n:integer, chan:address:channel <- read chan:address:channel + n:number, chan:address:channel <- read chan:address:channel # other threads might get between these prints - $print [consume: ], n:integer, [ + $print [consume: ], n:number, [ ] loop } @@ -36,8 +36,8 @@ recipe main [ default-space:address:array:location <- new location:type, 30:literal chan:address:channel <- init-channel 3:literal # create two background 'routines' that communicate by a channel - routine1:integer <- start-running producer:recipe, chan:address:channel - routine2:integer <- start-running consumer:recipe, chan:address:channel - wait-for-routine routine1:integer - wait-for-routine routine2:integer + routine1:number <- start-running producer:recipe, chan:address:channel + routine2:number <- start-running consumer:recipe, chan:address:channel + wait-for-routine routine1:number + wait-for-routine routine2:number ] |