summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-11-15 06:56:09 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-11-15 06:56:09 -0800
commit1c37de6f45dd9f383c9a52e937344c604340f436 (patch)
tree402aa37aa160ef922df3d02d77617c5b38e453ae /txr.1
parent8230a637a32ce0c88ba1c51aeb6c2d5edcece109 (diff)
downloadtxr-1c37de6f45dd9f383c9a52e937344c604340f436.tar.gz
txr-1c37de6f45dd9f383c9a52e937344c604340f436.tar.bz2
txr-1c37de6f45dd9f383c9a52e937344c604340f436.zip
rfind-if: optimized rewrite and hash support.
* lib.c (rfind_if): Function rewritten to use the seq_info sequence classification mechanism, for much better performance on vector-like objects. Also, supports hash tables just like find_if. * txr.1: Documentation updated regarding hash support of rfind-if.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.114
1 files changed, 13 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index d7f3ad91..26bc2051 100644
--- a/txr.1
+++ b/txr.1
@@ -27491,7 +27491,7 @@ then these cells are taken as their keys.
.coNP Functions @ rfind and @ rfind-if
.synb
.mets (rfind < key < sequence >> [ testfun <> [ keyfun ]])
-.mets (rfind-if < predfun < sequence <> [ keyfun ])
+.mets (rfind-if < predfun >> { sequence | << hash } <> [ keyfun ])
.syne
.desc
The
@@ -27509,6 +27509,18 @@ in
they return the right-most element rather than
the leftmost.
+In the case of
+.code rfind-if
+when a
+.meta hash
+is specified instead of a
+.metn sequence ,
+the function searches through the hash entries in the same order as
+.codn find-if ,
+but finds the last match rather than the first.
+Note: hashes are inherently not ordered; the relative order of items in
+a hash table can change when other items are inserted or deleted.
+
.coNP Functions @ find-max and @ find-min
.synb
.mets (find-max >> { sequence | << hash } >> [ testfun <> [ keyfun ]])