summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-09-03 23:29:24 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-09-03 23:29:24 -0700
commit1777ba3dc87c62cf18cd178f2055369979907dc8 (patch)
treea59a11cb6070442cc778618f1824badd55394f88 /txr.1
parentc98f779588624b9f5479c9740920e7760a1f7d98 (diff)
downloadtxr-1777ba3dc87c62cf18cd178f2055369979907dc8.tar.gz
txr-1777ba3dc87c62cf18cd178f2055369979907dc8.tar.bz2
txr-1777ba3dc87c62cf18cd178f2055369979907dc8.zip
New function: tailp.
* eval.c (eval_init): Register tailp intrinsic. * lib.c (tailp): New function. * lib.h (tailp): Declared. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.153
1 files changed, 53 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 003fa4a3..6bb2fc08 100644
--- a/txr.1
+++ b/txr.1
@@ -19568,6 +19568,59 @@ is only a function, not an accessor;
.code nthcdr
forms do not denote places.
+.coNP Function @ tailp
+.synb
+.mets (tailp < object << list)
+.syne
+.desc
+The
+.code tailp
+function tests whether
+.meta object
+is a tail of
+.metn list .
+This means that
+.meta object
+is either
+.meta list
+itself, or else one of the
+.code cons
+cells of
+.meta list
+or else the terminating atom of
+.metn list .
+
+More formally, a recursive definition follows.
+If
+.meta object
+and
+.meta list
+are the same object (thus equal under the
+.code eq
+function) then
+.code tailp
+returns
+.codn t .
+If
+.meta list
+is an atom, and is not
+.metn object ,
+then the function returns
+.codn nil .
+Otherwise,
+.meta list
+is a
+.code cons
+that is not
+.meta object
+and
+.code tailp
+yields the same value as the
+.mono
+.meti "(tailp < object (cdr << list ))"
+.onom
+expression.
+
.coNP Accessors @, caar @, cadr @, cdar @, cddr @ ... and @ cdddddr
.synb
.mets (caar << object )