summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kyheku <kaz@kylheku.com>2020-02-24 23:03:08 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-24 23:03:08 -0800
commit0e3c047c3fa3ef7d3e7168314bf6fdb0ba15443d (patch)
treeef7aa64fa706ae84f823cb725b63c4b91b4be4b5 /txr.1
parent3830cf321258321719865709081a709c97fd4e0a (diff)
downloadtxr-0e3c047c3fa3ef7d3e7168314bf6fdb0ba15443d.tar.gz
txr-0e3c047c3fa3ef7d3e7168314bf6fdb0ba15443d.tar.bz2
txr-0e3c047c3fa3ef7d3e7168314bf6fdb0ba15443d.zip
New function: assq and rassq.
TXR Lisp is henceforth a dialect in which (cdr (assq key a-list)) works exactly as shown, without substitution of assql or assoc. * eval.c (eval_init): Register assq and rassq intrinsics. * lib.c (assq, rassq): New functions. * lib.h (assq, rassq): Declared. * txr.1: Documented. * tests/012/ashwin.tl: New file. * tests/012/ashwin.expected: New file.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.135
1 files changed, 23 insertions, 12 deletions
diff --git a/txr.1 b/txr.1
index ea0f07cf..9ca02f9f 100644
--- a/txr.1
+++ b/txr.1
@@ -20394,28 +20394,35 @@ The first such cons is returned. If no such cons is found,
.code nil
is returned.
-.coNP Function @ assql
+.coNP Functions @ assq and @ assql
.synb
+.mets (assq < key << alist )
.mets (assql < key << alist )
.syne
.desc
The
+.code assq
+and
.code assql
-function is just like
+functions are very similar to
.codn assoc ,
-except that the equality test
-is determined using the
+with the only difference being that they determine equality using,
+respectively, the
+.code eq
+and
.code eql
-function rather than
+functions rather than
.codn equal .
-.coNP Functions @ rassql and @ rassoc
+.coNP Functions @, rassq @ rassql and @ rassoc
.synb
+.mets (rassq < value << alist )
.mets (rassql < value << alist )
.mets (rassoc < value << alist )
.syne
.desc
The
+.codn rassq ,
.code rassql
and
.code rassoc
@@ -20432,7 +20439,7 @@ rather than the
field.
The
-.code rassql
+.code rassoc
function searches association list
.meta alist
for a cons whose
@@ -20440,18 +20447,22 @@ for a cons whose
field equivalent to
.meta value
according to the
-.code eql
+.code equal
function. If such a cons is found, it is returned.
Otherwise
.code nil
is returned.
The
-.code rassoc
-function searches in the same way as
+.code rassq
+and
.code rassql
-but compares values using
-.codn equal .
+functions search in the same way as
+.code rassoc
+but compares values using, respectively,
+.code eq
+and
+.codn eql .
.coNP Function @ acons
.synb