diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-26 16:37:54 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-26 16:37:54 -0700 |
commit | ab59762e97c7f68f271fde7401d93c26bbbe7d6d (patch) | |
tree | ccde357039e09ec823b545aab369ae94308471f0 /tests | |
parent | d152f874b7096d6642a00b8237a94b6fd9991c00 (diff) | |
download | txr-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.tl | 7 | ||||
-rw-r--r-- | tests/016/ud-arith.tl | 2 |
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) |