diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-09-03 23:29:24 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-09-03 23:29:24 -0700 |
commit | 1777ba3dc87c62cf18cd178f2055369979907dc8 (patch) | |
tree | a59a11cb6070442cc778618f1824badd55394f88 /txr.1 | |
parent | c98f779588624b9f5479c9740920e7760a1f7d98 (diff) | |
download | txr-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.1 | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -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 ) |