diff options
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, [ ] ] |