summaryrefslogtreecommitdiffstats
path: root/tests/012
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-12-22 07:21:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-12-22 07:21:26 -0800
commite2ff7c1811deb19d0dab2142b99cfcb4b30e62df (patch)
tree25dcd25d5a48f60fc8c372865329027248268422 /tests/012
parent638293d5281db1276a3b64f2eb969ad99c0ee9f3 (diff)
downloadtxr-e2ff7c1811deb19d0dab2142b99cfcb4b30e62df.tar.gz
txr-e2ff7c1811deb19d0dab2142b99cfcb4b30e62df.tar.bz2
txr-e2ff7c1811deb19d0dab2142b99cfcb4b30e62df.zip
The pairlis function comes to TXR Lisp.
* eval.c (eval_init): Register pairlis intrinsic. * lib.c, lib.h (pairlis): New function. * tests/012/seq.tl: New test cases. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests/012')
-rw-r--r--tests/012/seq.tl8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/012/seq.tl b/tests/012/seq.tl
index ed2e02b8..1bc45b55 100644
--- a/tests/012/seq.tl
+++ b/tests/012/seq.tl
@@ -437,3 +437,11 @@
(mtest
[subst "brown" "black" #("how" "now" "BROWN" "cow") : downcase-str] #("how" "now" "black" "cow")
[subst 5 0 '(1 2 3 4 5 6 7 8 9 10) <] (1 2 3 4 5 0 0 0 0 0))
+
+(mtest
+ (pairlis nil nil) nil
+ (pairlis "abc" #(1 2 3 4)) ((#\a . 1) (#\b . 2) (#\c . 3))
+ (pairlis "abcd" #(1 2 3)) ((#\a . 1) (#\b . 2) (#\c . 3))
+ (pairlis "" #(1 2 3)) nil
+ (pairlis "abcd" #()) nil
+ (pairlis '(1 2 3) '(a b c) '(4 5 6)) ((1 . a) (2 . b) (3 . c) 4 5 6))