summaryrefslogtreecommitdiffstats
path: root/filter.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-22 00:58:18 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-22 00:58:18 -0800
commitaded325cb48f684b3a0849acde7ec31db48733ce (patch)
treeb87dce2ae9df01a1f66d3c2ff43af93e3047387e /filter.c
parent9462f8c7b3d57ccaaa73fd0e891f8a82b41c4b84 (diff)
downloadtxr-aded325cb48f684b3a0849acde7ec31db48733ce.tar.gz
txr-aded325cb48f684b3a0849acde7ec31db48733ce.tar.bz2
txr-aded325cb48f684b3a0849acde7ec31db48733ce.zip
The C function nullp is being renamed to null, and the rarely
used global variable null which holds a symbol becomes null_s. A new macro called nilp is added that more efficiently checks whether an object is nil, producing a C boolean value rather than t or nil. Most of the uses of nullp in the codebase just become the more streamlined nilp. * debug.c (show_bindings): nullp to nilp * eval.c (lookup_var, lookup_var_l, lookup_fun, lookup_sym_lisp1, do_eval, expand_qquote, expand_quasi, expand_op): nullp to nilp. (op_modplace): nullp to null. (eval_init): Update registration of null and not from C function nullp to null. * filter.c (trie_compress, html_hex_continue): nullp to nil. (filter_string_tree): null to null_s. * hash.c (hash_next): nullp to nilp. * lib.c (null): Variable renamed to null_s. (code2type): null to null_s. (lazy_flatten_scan, chainv, lazy_str, lazy_str_force_upto, obj_print, obj_pprint): nullp to nilp. (obj_init): null to null_s; nullp to null. * lib.h (null): declaration changed to null_s. (nullp): Inline function renamed to null. (nilp): New macro. * match.c (do_match_line): nullp to nilp. * rand.c (make_random_state): Likewise. * regex.c (compile_regex): Likewise.
Diffstat (limited to 'filter.c')
-rw-r--r--filter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/filter.c b/filter.c
index f8633b7b..29911ba9 100644
--- a/filter.c
+++ b/filter.c
@@ -93,7 +93,7 @@ static void trie_compress(val *ptrie)
if (zerop(count)) {
set(*ptrie, value);
- } else if (eq(count, one) && nullp(value)) {
+ } else if (eq(count, one) && nilp(value)) {
val iter = hash_begin(trie);
val cell = hash_next(iter);
set(*ptrie, cons(car(cell), cdr(cell)));
@@ -246,7 +246,7 @@ val filter_string_tree(val filter, val obj)
{
val type = typeof(filter);
- if (eq(type, null))
+ if (eq(type, null_s))
return obj;
if (eq(type, hash_s) || eq(type, cons_s))
return trie_filter_string(filter, obj);
@@ -553,7 +553,7 @@ static val html_hex_continue(val hexlist, val ch)
wchar_t out[2] = { 0 };
val iter;
- if (nullp(hexlist))
+ if (nilp(hexlist))
return nil;
for (iter = nreverse(hexlist); iter; iter = cdr(iter)) {