From 87626d48be8c54b4aa53cb4829ff1c3fc34eb02e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 20 Nov 2014 19:24:45 -0800 Subject: * lib.c (where): Argument order reversed, with compat support. * lib.h (where): Declaration updated. * txr.1: Documented. --- lib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index c4e6395f..7c65876c 100644 --- a/lib.c +++ b/lib.c @@ -6180,10 +6180,16 @@ val search(val seq, val key, val testfun, val keyfun) return seq; } -val where(val seq_in, val func) +val where(val func, val seq_in) { list_collect_decl (out, ptail); + if (opt_compat && opt_compat <= 100) { + val f = seq_in, s = func; + func = s; + seq_in = f; + } + if (hashp(seq_in)) { val hiter = hash_begin(seq_in); val cell; -- cgit v1.2.3