summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-15 06:39:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-15 06:39:11 -0700
commita3c8effa1337c16e9c7832bf1fb4e66f72e5c3c8 (patch)
tree56a215529f5185cf38ea456b879bc9710bd4f115 /txr.1
parentd6f725293fdfd7d28ab5938256866b1fd3b49fe1 (diff)
downloadtxr-a3c8effa1337c16e9c7832bf1fb4e66f72e5c3c8.tar.gz
txr-a3c8effa1337c16e9c7832bf1fb4e66f72e5c3c8.tar.bz2
txr-a3c8effa1337c16e9c7832bf1fb4e66f72e5c3c8.zip
New keepq, keepql and keepqual functions.
* eval.c (eval_init): Register keepq, keepql and keepqual intrinsic functions. * lib.c (keepq, keepql, keepqual): New functions. * lib.h (keepq, keepql, keepqual): Declared.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.143
1 files changed, 43 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 96b15fe8..72607129 100644
--- a/txr.1
+++ b/txr.1
@@ -22497,6 +22497,49 @@ does not have to be deleted, in order to instantiate the first lazy value.
[(remql* 13 (range 1)) 0..100]
.cble
+.coNP Functions @, keepq @ keepql and @ keepqual
+.synb
+.mets (keepq < object < list <> [ key-function ])
+.mets (keepql < object < list <> [ key-function ])
+.mets (keepqual < object < list <> [ key-function ])
+.syne
+.desc
+The
+.codn keepq ,
+.code keepql
+and
+.code keepqual
+functions produce a new list based on
+.metn list ,
+removing the items whose keys are not
+.codn eq ,
+.code eql
+or
+.code equal
+to
+.metn object .
+
+The input
+.meta list
+is unmodified, but the returned list may share substructure
+with it. If no items are removed, it is possible that the return value
+is
+.meta list
+itself.
+
+The optional
+.meta key-function
+is applied to each element from the
+.meta list
+to convert it to a key which is compared to
+.metn object .
+If
+.meta key-function
+is omitted, then each element itself of
+.meta list
+is compared to
+.metn object .
+
.coNP Functions @, remove-if @, keep-if @ remove-if* and @ keep-if*
.synb
.mets (remove-if < predicate-function < list <> [ key-function ])