From 763f15ad2b8327a04b0dad97982bf19150aa7397 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 25 Oct 2011 11:22:34 -0400 Subject: * filter.c (fun_k): New keyword variable. (function_filter): Use :fun keyword symbol instead of fun. (filter_init): New keyword variable initialized. * filter.h (upcase_k, downcase_k, fun_k): Declared. --- ChangeLog | 8 ++++++++ filter.c | 11 ++++++----- filter.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1598515b..3bc5f3df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-10-25 Kaz Kylheku + + * filter.c (fun_k): New keyword variable. + (function_filter): Use :fun keyword symbol instead of fun. + (filter_init): New keyword variable initialized. + + * filter.h (upcase_k, downcase_k, fun_k): Declared. + 2011-10-25 Kaz Kylheku * match.c (v_bind): Use sem_error to throw errors with line number diff --git a/filter.c b/filter.c index 8d34b677..85704240 100644 --- a/filter.c +++ b/filter.c @@ -36,6 +36,10 @@ #include "filter.h" #include "gc.h" +val filters; +val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; +val upcase_k, downcase_k, fun_k; + static val make_trie(void) { return make_hash(nil, nil); @@ -142,7 +146,7 @@ static val function_filter(val functions, val string) val get_filter(val spec) { if (consp(spec)) { - if (car(spec) == fun_s) { + if (car(spec) == fun_k) { return curry_12_2(func_n2(function_filter), rest(spec)); } else { val filter_list = mapcar(func_n1(get_filter), spec); @@ -575,10 +579,6 @@ static val html_numeric_handler(val ch) return func_f1(cons(ch, nil), html_dec_continue); } -val filters; -val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; -val upcase_k, downcase_k; - void filter_init(void) { protect(&filters, (val *) 0); @@ -591,6 +591,7 @@ void filter_init(void) from_html_k = intern(lit("from_html"), keyword_package); upcase_k = intern(lit("upcase"), keyword_package); downcase_k = intern(lit("downcase"), keyword_package); + fun_k = intern(lit("fun"), keyword_package); sethash(filters, to_html_k, build_filter(to_html_table, t)); { val trie = build_filter(from_html_table, nil); diff --git a/filter.h b/filter.h index 136bb67b..4eb317d1 100644 --- a/filter.h +++ b/filter.h @@ -26,6 +26,7 @@ extern val filters; extern val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; +extern val upcase_k, downcase_k, fun_k; val trie_lookup_begin(val trie); val trie_value_at(val node); -- cgit v1.2.3