diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib.c | 8 | ||||
-rw-r--r-- | lib.h | 2 | ||||
-rw-r--r-- | txr.1 | 6 |
4 files changed, 21 insertions, 3 deletions
@@ -1,5 +1,13 @@ 2014-11-20 Kaz Kylheku <kaz@kylheku.com> + * lib.c (where): Argument order reversed, with compat support. + + * lib.h (where): Declaration updated. + + * txr.1: Documented. + +2014-11-20 Kaz Kylheku <kaz@kylheku.com> + * lib.c (sel): Accept a function in place of the index list. * txr.1: Documented. @@ -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; @@ -810,7 +810,7 @@ val refset(val seq, val ind, val newval); val replace(val seq, val items, val from, val to); val update(val seq, val fun); val search(val seq, val key, val from, val to); -val where(val seq, val func); +val where(val func, val seq); val sel(val seq, val where); val env(void); val obj_print(val obj, val stream); @@ -13278,7 +13278,7 @@ the resulting value is used in its place. .coNP Function @ where .synb -.mets (where < object << function ) +.mets (where < function << object ) .syne .desc @@ -26079,6 +26079,10 @@ individual characters as if by calling .codn list-str . This behavior changed to the currently documented behavior starting in \*(TX 101. +Also, the arguments of the +.code where +function, which introduced in \*(TX 91, were reversed starting +in \*(TX 101. .IP 99 Up to \*(TX 99, the substitution of TXR Lisp expressions in |