diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-11-20 19:08:22 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-11-20 19:08:22 -0800 |
commit | e680fcaaa59d181af0356d7446ca1e5628598215 (patch) | |
tree | 1bae4a1e7631719fe405728a21c2ea9400eae04b /lib.c | |
parent | dececfe937e68c45c3658cf9fa30bcde362d30ff (diff) | |
download | txr-e680fcaaa59d181af0356d7446ca1e5628598215.tar.gz txr-e680fcaaa59d181af0356d7446ca1e5628598215.tar.bz2 txr-e680fcaaa59d181af0356d7446ca1e5628598215.zip |
* lib.c (sel): Accept a function in place of the index list.
* txr.1: Documented.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -6209,7 +6209,9 @@ val sel(val seq_in, val where_in) { list_collect_decl (out, ptail); val seq = nullify(seq_in); - val where = nullify(where_in); + val where = if3(functionp(where_in), + funcall1(where_in, seq), + nullify(where_in)); switch (type(seq)) { case NIL: |