diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-26 11:26:10 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-26 11:26:10 -0700 |
commit | bafc7192b2cc1d4a7d1cf4584e3c6c06d7ec979f (patch) | |
tree | 3f4ab635fe72a1dc88b85d92c70dc9e70b30b512 | |
parent | c15dedb7e2389d765bd07ea304fe33660763583b (diff) | |
download | mu-bafc7192b2cc1d4a7d1cf4584e3c6c06d7ec979f.tar.gz |
1469
-rw-r--r-- | counters.mu | 12 | ||||
-rw-r--r-- | factorial.mu | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/counters.mu b/counters.mu index 71d9cfc9..dab6850f 100644 --- a/counters.mu +++ b/counters.mu @@ -4,7 +4,7 @@ recipe init-counter [ default-space:address:array:location <- new location:type, 30:literal n:number <- next-ingredient - reply default-space:address:space + reply default-space:address:array:location ] recipe increment-counter [ @@ -18,13 +18,13 @@ recipe increment-counter [ recipe main [ default-space:address:array:location <- new location:type, 30:literal # counter A - a:address:space <- init-counter 34:literal + a:address:array:location <- init-counter 34:literal # counter B - b:address:space <- init-counter 23:literal + b:address:array:location <- init-counter 23:literal # increment both by 2 but in different ways - increment-counter a:address:space, 1:literal - b-value:number <- increment-counter b:address:space, 2:literal - a-value:number <- increment-counter a:address:space, 1:literal + increment-counter a:address:array:location, 1:literal + b-value:number <- increment-counter b:address:array:location, 2:literal + a-value:number <- increment-counter a:address:array:location, 1:literal # check results $print [Contents of counters ] diff --git a/factorial.mu b/factorial.mu index 4972b943..bdead927 100644 --- a/factorial.mu +++ b/factorial.mu @@ -1,7 +1,7 @@ # example program: compute the factorial of 5 recipe main [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:number <- factorial 5:literal $print [result: ], x:number, [ ] @@ -28,7 +28,7 @@ scenario factorial-test [ run [ 1:number <- factorial 5:literal ] - memory should contain [ + memory-should-contain [ 1 <- 120 ] ] |