From e81420e6a4f0b13122938db7e137151ca88b96eb Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 24 Jul 2016 15:58:26 -0700 Subject: 3148 --- lambda-to-mu.mu | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lambda-to-mu.mu b/lambda-to-mu.mu index da33a358..e09a078f 100644 --- a/lambda-to-mu.mu +++ b/lambda-to-mu.mu @@ -87,6 +87,23 @@ scenario pair-is-not-atom [ ] ] +def atom-match? x:address:cell, pat:address:array:character -> result:boolean [ + local-scope + load-ingredients + s:address:array:character, is-atom?:boolean <- maybe-convert *x, atom:variant + reply-unless is-atom?, 0/false + result <- equal pat, s +] + +scenario atom-match [ + local-scope + x:address:cell <- new-atom [abc] + 10:boolean/raw <- atom-match? x, [abc] + memory-should-contain [ + 10 <- 1 + ] +] + def first x:address:cell -> result:address:cell [ local-scope load-ingredients -- cgit 1.4.1-2-gfad0