summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-11-20 19:24:45 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-11-20 19:24:45 -0800
commit87626d48be8c54b4aa53cb4829ff1c3fc34eb02e (patch)
treef22e2ea9374d521a1cd346f80e9da99496e487a7 /lib.c
parente680fcaaa59d181af0356d7446ca1e5628598215 (diff)
downloadtxr-87626d48be8c54b4aa53cb4829ff1c3fc34eb02e.tar.gz
txr-87626d48be8c54b4aa53cb4829ff1c3fc34eb02e.tar.bz2
txr-87626d48be8c54b4aa53cb4829ff1c3fc34eb02e.zip
* lib.c (where): Argument order reversed, with compat support.
* lib.h (where): Declaration updated. * txr.1: Documented.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c8
1 files changed, 7 insertions, 1 deletions
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;