summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-11 17:33:00 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-11 17:33:00 -0800
commit3c32f8de768338c0f64b1218a2f60f85d59c36ce (patch)
tree6465f8b1092d6ab46d4eae1ae9fa910f85b1643c /txr.1
parent15dda4428072bb741d6bf42fa4906b217fc2aeb1 (diff)
downloadtxr-3c32f8de768338c0f64b1218a2f60f85d59c36ce.tar.gz
txr-3c32f8de768338c0f64b1218a2f60f85d59c36ce.tar.bz2
txr-3c32f8de768338c0f64b1218a2f60f85d59c36ce.zip
* eval.c (eval_init): Register new functions posqual, posql,
posq, pos, and pos_if as intrinsics. * lib.c (posqual, posql, posq, pos, pos_if): New functions. * lib.h (posqual, posql, posq, pos, pos_if): Declared. * txr.1: Documented
Diffstat (limited to 'txr.1')
-rw-r--r--txr.162
1 files changed, 62 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 93aca12d..976b4c34 100644
--- a/txr.1
+++ b/txr.1
@@ -7025,6 +7025,68 @@ transformed to an argument to <predicate-function>. If this argument is omitted
then the predicate function is applied to the elements directly, a behavior
which is identical to <key-function> being (fun identity).
+.SS Functions posqual, posql and posq
+
+.TP
+Syntax:
+
+ (posq <object> <list>)
+ (posql <object> <list>)
+ (posqual <object> <list>)
+
+.TP
+Description
+
+The posq, posql and posqual functions return the zero-based position of the
+first item in <list> which is, respectively, eq, eql or equal to <object>.
+
+.SS Functions posqual, posql and posq
+
+.TP
+Syntax:
+
+ (posq <object> <list>)
+ (posql <object> <list>)
+ (posqual <object> <list>)
+
+.TP
+Description
+
+The posq, posql and posqual functions return the zero-based position of the
+first item in <list> which is, respectively, eq, eql or equal to <object>.
+
+.SS Functions pos and pos-if
+
+.TP
+Syntax:
+
+ (pos <key> <list> [<testfun> [<keyfun>]])
+ (pos-if <predfun> <list> [<keyfun>])
+
+.TP
+Description:
+
+The pos and pos-if functions search through a list for an item which
+matches a key, or satisfies a predicate function, respectively.
+They return the zero based position of the matching item.
+
+The keyfun argument specifies a function which is applied to the elements
+of the list to produce the comparison key. If this argument is omitted,
+then the untransformed elements of the list themselves are searched.
+
+The pos function's testfun argument specifies the test function which
+is used to compare the comparison keys from the list to the search key.
+If this argument is omitted, then the equal function is used.
+The position of the first element from the list whose comparison key (as
+retrieved by the key function) matches the search (under the test function) is
+returned. If no such element is found, nil is returned.
+
+The pos-if function's predfun argument specifies a predicate function
+which is applied to the successive comparison keys pulled from the list
+by applying the key function to successive elements. The position of
+the first element for which the predicate function yields true is returned. If
+no such element is found, nil is returned.
+
.SS Function tree-find
.TP