diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-10-22 20:02:45 -0400 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-10-22 20:02:45 -0400 |
commit | c6de88f486896be891e73009dbe2ea0411bf89e1 (patch) | |
tree | 78a4401ba4035004bf7bf1575f729dacd16b81a7 /filter.c | |
parent | 6ddb4b8f329b14e6133f29573cfeb88d1ee30846 (diff) | |
download | txr-c6de88f486896be891e73009dbe2ea0411bf89e1.tar.gz txr-c6de88f486896be891e73009dbe2ea0411bf89e1.tar.bz2 txr-c6de88f486896be891e73009dbe2ea0411bf89e1.zip |
Task #11474
* filter.c (filter_equal): Takes two filters instead of one.
(lfilt_k, rfilt_k): New keyword variables.
(filter_init): New keyword variables initialized.
* filter.h (filter_equal): Declaration updated.
(lfilt_k, rfilt_k): Declared.
* lib.c (funcall4): New function.
(do_curry_1234_34): New static function.
(curry_1234_34): New function.
(do_swap_12_21): New static function.
(swap_12_21): New function.
* lib.h (funcall4, curry_1234_34, swap_12_21): Declared.
* match.c (dest_bind): Swap use the function argument swapping
combinator when calling tree find such that the value
being searched is on the left and pattern material is on the right.
(v_bind): Implemented :lfilt and :rfilt.
* txr.1: Documented :lfilt and :rfilt.
Diffstat (limited to 'filter.c')
-rw-r--r-- | filter.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -231,10 +231,10 @@ val filter_string(val filter, val str) uw_throwf(error_s, lit("filter_string: invalid filter ~a"), filter, nao); } -val filter_equal(val filter, val left, val right) +val filter_equal(val lfilt, val rfilt, val left, val right) { if (stringp(left) && stringp(right)) - return equal(filter_string(filter, left), filter_string(filter, right)); + return equal(filter_string(lfilt, left), filter_string(rfilt, right)); return equal(left, right); } @@ -565,7 +565,7 @@ static val html_numeric_handler(val ch) } val filters; -val filter_k, to_html_k, from_html_k; +val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; val upcase_k, downcase_k; void filter_init(void) @@ -574,6 +574,8 @@ void filter_init(void) filters = make_hash(nil, nil); filter_k = intern(lit("filter"), keyword_package); + lfilt_k = intern(lit("lfilt"), keyword_package); + rfilt_k = intern(lit("rfilt"), keyword_package); to_html_k = intern(lit("to_html"), keyword_package); from_html_k = intern(lit("from_html"), keyword_package); upcase_k = intern(lit("upcase"), keyword_package); |