diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-06-25 20:25:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-06-25 20:25:51 -0700 |
commit | d5e7ea92ffcde75c4401e009c74d63ee70ba9ff2 (patch) | |
tree | 22044684ec1b7869af03ffbf8cf639feff91b874 /lib.c | |
parent | b30ef1a6cb0892c142cd8ccad671e1ad2dae903a (diff) | |
download | txr-d5e7ea92ffcde75c4401e009c74d63ee70ba9ff2.tar.gz txr-d5e7ea92ffcde75c4401e009c74d63ee70ba9ff2.tar.bz2 txr-d5e7ea92ffcde75c4401e009c74d63ee70ba9ff2.zip |
in: allow hash with keyfun and testfun.
* lib.c (in): A simple check and fallthrough lets this
function process hash tables more generally in this function.
* txr.1: Documented.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -9709,7 +9709,9 @@ val in(val seq, val item, val testfun, val keyfun) default: switch (si.kind) { case SEQ_HASHLIKE: - return tnil(gethash_e(self, si.obj, item)); + if (null_or_missing_p(testfun) && null_or_missing_p(keyfun)) + return tnil(gethash_e(self, si.obj, item)); + /* fallthrough */ case SEQ_LISTLIKE: case SEQ_VECLIKE: { |