summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-26 16:37:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-26 16:37:54 -0700
commitab59762e97c7f68f271fde7401d93c26bbbe7d6d (patch)
treeccde357039e09ec823b545aab369ae94308471f0 /tests
parentd152f874b7096d6642a00b8237a94b6fd9991c00 (diff)
downloadtxr-ab59762e97c7f68f271fde7401d93c26bbbe7d6d.tar.gz
txr-ab59762e97c7f68f271fde7401d93c26bbbe7d6d.tar.bz2
txr-ab59762e97c7f68f271fde7401d93c26bbbe7d6d.zip
New function: arithp.
* lib.h (arithp): Declared. (plus_s): Existing symbol declared. * arith.c (arithp): New function. * struct.h (special_slot): New enum member plus_m. * struct.c (special_sym): Register plus_s together as the [plus_m] entry of the array. * tests/016/arith.tl * tests/016/ud-arith.tl: Tests for arithp. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests')
-rw-r--r--tests/016/arith.tl7
-rw-r--r--tests/016/ud-arith.tl2
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/016/arith.tl b/tests/016/arith.tl
index 86b5d9bb..d67b9908 100644
--- a/tests/016/arith.tl
+++ b/tests/016/arith.tl
@@ -405,3 +405,10 @@
(test
(build (each-prod* ((i '(b c)) (j (cons 'a i))) (add (list i j))))
((b a) (b b) (b c) (c a) (c b) (c c)))
+
+(mtest
+ (arithp #\a) t
+ (arithp 42) t
+ (arithp 3.14) t
+ (arithp (expt 2 200)) t
+ (arithp #R(nil nil)) t)
diff --git a/tests/016/ud-arith.tl b/tests/016/ud-arith.tl
index 052fcaed..5d07349a 100644
--- a/tests/016/ud-arith.tl
+++ b/tests/016/ud-arith.tl
@@ -138,3 +138,5 @@
(test (ash n 0) (ash 1 0))
(test (width n) (width 1))
(test (logcount n) (logcount 1))
+
+(test (arithp n) t)