diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-29 01:23:22 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-29 01:23:22 -0700 |
commit | ce87c19ee42bc52c5ab9a1ee3c431a9423e5a885 (patch) | |
tree | 126e2445997e1d5a35d80f2999744654dfe8e721 /counters.mu | |
parent | c91caafd5bd5dae25b0e0efa19879258ff61ad93 (diff) | |
download | mu-ce87c19ee42bc52c5ab9a1ee3c431a9423e5a885.tar.gz |
1880 - switch .mu files to new type-deducing idiom
Diffstat (limited to 'counters.mu')
-rw-r--r-- | counters.mu | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/counters.mu b/counters.mu index 6428ff9b..be1f098a 100644 --- a/counters.mu +++ b/counters.mu @@ -4,14 +4,14 @@ recipe new-counter [ default-space:address:array:location <- new location:type, 30 n:number <- next-ingredient - reply default-space:address:array:location + reply default-space ] recipe increment-counter [ local-scope 0:address:array:location/names:new-counter <- next-ingredient # setup outer space; it *must* come from 'new-counter' x:number <- next-ingredient - n:number/space:1 <- add n:number/space:1, x:number + n:number/space:1 <- add n:number/space:1, x reply n:number/space:1 ] @@ -22,13 +22,13 @@ recipe main [ # counter B b:address:array:location <- new-counter 23 # increment both by 2 but in different ways - increment-counter a:address:array:location, 1 - b-value:number <- increment-counter b:address:array:location, 2 - a-value:number <- increment-counter a:address:array:location, 1 + increment-counter a, 1 + b-value:number <- increment-counter b, 2 + a-value:number <- increment-counter a, 1 # check results $print [Contents of counters ] # trailing space in next line is to help with syntax highlighting - $print [a: ], a-value:number, [ b: ], b-value:number, [ + $print [a: ], a-value, [ b: ], b-value, [ ] ] |