From d5e7ea92ffcde75c4401e009c74d63ee70ba9ff2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 25 Jun 2019 20:25:51 -0700 Subject: 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. --- lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 1d76aa65..40662d29 100644 --- a/lib.c +++ b/lib.c @@ -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: { -- cgit v1.2.3