diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-07-24 15:58:15 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-07-24 15:58:15 -0700 |
commit | 301a6fb1cac67768cbdca6def6bfef149652f274 (patch) | |
tree | 158a55b6ee13af0412e086616b2d518a08b58e99 /lambda-to-mu.mu | |
parent | cde1efadecaf19e15db217ffd5cdbc043d0289fe (diff) | |
download | mu-301a6fb1cac67768cbdca6def6bfef149652f274.tar.gz |
3147
Diffstat (limited to 'lambda-to-mu.mu')
-rw-r--r-- | lambda-to-mu.mu | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lambda-to-mu.mu b/lambda-to-mu.mu index db6d1dfc..da33a358 100644 --- a/lambda-to-mu.mu +++ b/lambda-to-mu.mu @@ -61,24 +61,6 @@ def is-pair? x:address:cell -> result:boolean [ _, result <- maybe-convert *x, pair:variant ] -def set-first base:address:cell, new-first:address:cell -> base:address:cell [ - local-scope - load-ingredients - pair:pair, is-pair?:boolean <- maybe-convert *base, pair:variant - reply-unless is-pair? - pair <- put pair, first:offset, new-first - *base <- merge 1/pair, pair -] - -def set-rest base:address:cell, new-rest:address:cell -> base:address:cell [ - local-scope - load-ingredients - pair:pair, is-pair?:boolean <- maybe-convert *base, pair:variant - reply-unless is-pair? - pair <- put pair, rest:offset, new-rest - *base <- merge 1/pair, pair -] - scenario atom-is-not-pair [ local-scope s:address:array:character <- new [a] @@ -121,6 +103,24 @@ def rest x:address:cell -> result:address:cell [ result <- get pair, rest:offset ] +def set-first base:address:cell, new-first:address:cell -> base:address:cell [ + local-scope + load-ingredients + pair:pair, is-pair?:boolean <- maybe-convert *base, pair:variant + reply-unless is-pair? + pair <- put pair, first:offset, new-first + *base <- merge 1/pair, pair +] + +def set-rest base:address:cell, new-rest:address:cell -> base:address:cell [ + local-scope + load-ingredients + pair:pair, is-pair?:boolean <- maybe-convert *base, pair:variant + reply-unless is-pair? + pair <- put pair, rest:offset, new-rest + *base <- merge 1/pair, pair +] + scenario cell-operations-on-atom [ local-scope s:address:array:character <- new [a] |