diff --git a/README.md b/README.md index 77551d5..6089ad4 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ We have a reasonable number of functions implemented, either in our golang core Building upon those primitives we have a larger standard-library of functions written in Lisp such as: -* `abs`, `apply`, `append`, `cond`, `count`, `filter`, `lower`, `map`, `min`, `max`, `ms`, `nat`, `neg`, `now`, `nth`, `reduce`, `repeat`, `reverse`, `seq`, `strlen`, `upper`, `when`, `while`, etc. +* `abs`, `apply`, `append`, `cond`, `count`, `false?`, `filter`, `lower`, `map`, `min`, `max`, `ms`, `nat`, `neg`, `now`, `nth`, `reduce`, `repeat`, `reverse`, `seq`, `strlen`, `true?`, `upper`, `when`, `while`, etc. Although the lists above should be up to date you can check the definitions to see what is currently available: diff --git a/stdlib/stdlib.lisp b/stdlib/stdlib.lisp index f70415b..f35672c 100644 --- a/stdlib/stdlib.lisp +++ b/stdlib/stdlib.lisp @@ -86,6 +86,11 @@ (define even? (lambda (n) (zero? (% n 2)))) (define odd? (lambda (n) (! (even? n)))) +;; +;; is the given argument "true", or "false"? +;; +(def! true? (fn* (arg) (if (eq #t arg) true false))) +(def! false? (fn* (arg) (if (eq #f arg) true false))) ;; Square root (define sqrt (lambda (x:number) (# x 0.5)))