summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--liblali.c2
2 files changed, 12 insertions, 2 deletions
diff --git a/README.md b/README.md
index 7f3492f..decd7b5 100644
--- a/README.md
+++ b/README.md
@@ -187,11 +187,19 @@ otherwise `f`:
(singul t) ; t
(singul '(a b)) ; f
-`(zerop x)` returns `t` if `x` is the number zero, otherwise `f`:
+`(zerop x)` returns `t` if `x` is the number positive zero, otherwise `f`:
(zerop +0) ; t
(zerop +1) ; f
- (zerop t) ; error: t is not a number
+ (zerop -0) ; f
+ (zerop 'a) ; f
+
+`(plural x)` returns `t` if `x` is not the number positive zero, otherwise `f`:
+
+ (plural +0) ; f
+ (plural +1) ; t
+ (plural -0) ; t
+ (plural 'a) ; t
### Logical operations
diff --git a/liblali.c b/liblali.c
index a8d8adc..a816ad8 100644
--- a/liblali.c
+++ b/liblali.c
@@ -1672,6 +1672,8 @@ static char *stdlib = LISP(
(defun zerop (x) (not (diff x +0)))
+ (defun plural (x) (diff x +0))
+
(defmacro and args
(fill ((algo args) t)
((algo (cdr args)) (car args))