whenLet, unlessLet

This commit is contained in:
2021-01-16 21:36:29 -07:00
parent 5be8276c42
commit 4fa26c0b9b
2 changed files with 28 additions and 9 deletions

View File

@@ -447,9 +447,11 @@
(Some b) some6]
(Assert.equals 11 (+ a b))
(Assert.fail))
(ifLet [(Some a) oops]
(Assert.fail))
(ifLet [(Some (or 5 6)) some5]
(Assert.pass))
(ifLet [(Some a) none]
(Assert.fail))
(whenLet [(Some a) oops]
(print "something went wrong!")
(Assert.fail))
(unlessLet [(Some (or 5 6)) some5]
(print "something else went wrong!")
(Assert.fail))))