diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-11-15 06:19:49 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-11-15 06:19:49 -0800 |
commit | 8230a637a32ce0c88ba1c51aeb6c2d5edcece109 (patch) | |
tree | f8580dade862468172873b42cd1aaf82b3676478 /txr.1 | |
parent | 6f7c75ed060f3c824740cf0a471be4a235f2fe51 (diff) | |
download | txr-8230a637a32ce0c88ba1c51aeb6c2d5edcece109.tar.gz txr-8230a637a32ce0c88ba1c51aeb6c2d5edcece109.tar.bz2 txr-8230a637a32ce0c88ba1c51aeb6c2d5edcece109.zip |
find-if: optimized rewrite and hash support.
* lib.c (find_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_max.
* txr.1: Documentation updated regarding hash support
of find-if.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -27419,7 +27419,7 @@ is returned. .coNP Functions @ find and @ find-if .synb .mets (find < key < sequence >> [ testfun <> [ keyfun ]]) -.mets (find-if < predfun < sequence <> [ keyfun ]) +.mets (find-if < predfun >> { sequence | << hash } <> [ keyfun ]) .syne .desc The @@ -27474,6 +27474,20 @@ element is found, .code nil is returned. +In the case of +.codn find-if , +a hash table may be specified instead of a sequence. +The +.meta hash +is treated as if it were a sequence of hash key and hash +value pairs represented as cons cells, the +.code car +slots of which are the hash keys, and the +.code cdr +of which are the hash values. If the caller doesn't specify a +.meta keyfun +then these cells are taken as their keys. + .coNP Functions @ rfind and @ rfind-if .synb .mets (rfind < key < sequence >> [ testfun <> [ keyfun ]]) |