diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-27 07:28:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-27 07:28:34 -0700 |
commit | b9cfb7a7ad2cb64cba3d1863feee63338b49e5eb (patch) | |
tree | acfa1010290b028dae1aeaf41292bd720d01bbe2 | |
parent | 366351ec32816b5076aedcc8b5f871c4bbad2690 (diff) | |
download | txr-b9cfb7a7ad2cb64cba3d1863feee63338b49e5eb.tar.gz txr-b9cfb7a7ad2cb64cba3d1863feee63338b49e5eb.tar.bz2 txr-b9cfb7a7ad2cb64cba3d1863feee63338b49e5eb.zip |
Renaming c_true to tnil.
Macros called c_* should produce C counterparts of
Lisp val objects, like c_num and c_str.
* lib.h (c_true): Renamed to tnil.
* eval.c (lexical_var_p, lexical_fun_p): c_true to tnil.
* lib.c (less, chr_isalnum, chr_isalnum, chr_isalpha,
chr_isascii, chr_iscntrl, chr_isdigit, chr_isgraph,
chr_islower, chr_isprint, chr_ispunct, chr_isspace,
chr_isblank, chr_isunisp, chr_isupper, chr_isxdigit,
chr_toupper, keywordp): Likewise.
* stream.c (catenated_stream_p): Likewise.
* sysif.c (wifexited, wifsignaled, wcoredump, wifstopped,
wifcontinued): Likewise.
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | lib.c | 32 | ||||
-rw-r--r-- | lib.h | 2 | ||||
-rw-r--r-- | stream.c | 2 | ||||
-rw-r--r-- | sysif.c | 10 |
5 files changed, 25 insertions, 25 deletions
@@ -368,7 +368,7 @@ static val lexical_var_p(val menv, val sym) val binding = assoc(sym, menv->e.vbindings); if (binding) /* special_s: see make_var_shadowing_env */ - return c_true(cdr(binding) == special_s); + return tnil(cdr(binding) == special_s); return lexical_var_p(menv->e.up_env, sym); } } @@ -385,7 +385,7 @@ static val lexical_fun_p(val menv, val sym) val binding = assoc(sym, menv->e.fbindings); if (binding) /* special_s: see make_var_shadowing_env */ - return c_true(cdr(binding) == special_s); + return tnil(cdr(binding) == special_s); return lexical_fun_p(menv->e.up_env, sym); } } @@ -3432,7 +3432,7 @@ val less(val left, val right) return nil; } - return c_true (lenl < lenr); + return tnil(lenl < lenr); } case FUN: case PKG: @@ -3533,72 +3533,72 @@ wchar_t c_chr(val chr) val chr_isalnum(val ch) { - return c_true(iswalnum(c_chr(ch))); + return tnil(iswalnum(c_chr(ch))); } val chr_isalpha(val ch) { - return c_true(iswalpha(c_chr(ch))); + return tnil(iswalpha(c_chr(ch))); } val chr_isascii(val ch) { - return c_true(c_chr(ch) >= 0 && c_chr(ch) < 128); + return tnil(c_chr(ch) >= 0 && c_chr(ch) < 128); } val chr_iscntrl(val ch) { - return c_true(iswcntrl(c_chr(ch))); + return tnil(iswcntrl(c_chr(ch))); } val chr_isdigit(val ch) { - return c_true(iswdigit(c_chr(ch))); + return tnil(iswdigit(c_chr(ch))); } val chr_isgraph(val ch) { - return c_true(iswgraph(c_chr(ch))); + return tnil(iswgraph(c_chr(ch))); } val chr_islower(val ch) { - return c_true(iswlower(c_chr(ch))); + return tnil(iswlower(c_chr(ch))); } val chr_isprint(val ch) { - return c_true(iswprint(c_chr(ch))); + return tnil(iswprint(c_chr(ch))); } val chr_ispunct(val ch) { - return c_true(iswpunct(c_chr(ch))); + return tnil(iswpunct(c_chr(ch))); } val chr_isspace(val ch) { - return c_true(iswspace(c_chr(ch))); + return tnil(iswspace(c_chr(ch))); } val chr_isblank(val ch) { - return c_true(ch == chr(' ') || ch == chr('\t')); + return tnil(ch == chr(' ') || ch == chr('\t')); } val chr_isunisp(val ch) { - return c_true(wcschr(spaces, c_chr(ch))); + return tnil(wcschr(spaces, c_chr(ch))); } val chr_isupper(val ch) { - return c_true(iswupper(c_chr(ch))); + return tnil(iswupper(c_chr(ch))); } val chr_isxdigit(val ch) { - return c_true(iswxdigit(c_chr(ch))); + return tnil(iswxdigit(c_chr(ch))); } val chr_toupper(val ch) @@ -3844,7 +3844,7 @@ val symbolp(val sym) val keywordp(val sym) { - return c_true(sym && symbolp(sym) && sym->s.package == keyword_package_var); + return tnil(sym && symbolp(sym) && sym->s.package == keyword_package_var); } loc get_user_package(void) @@ -927,7 +927,7 @@ INLINE int null_or_missing_p(val v) { return (nilp(v) || missingp(v)); } #define and3(a, b, c) ((a) && (b) ? (c) : nil) -#define c_true(c_cond) ((c_cond) ? t : nil) +#define tnil(c_cond) ((c_cond) ? t : nil) INLINE val default_arg(val arg, val dfl) { @@ -1870,7 +1870,7 @@ val make_catenated_stream_v(struct args *streams) val catenated_stream_p(val obj) { - return if2(streamp(obj), c_true(obj->co.ops == &cat_stream_ops.cobj_ops)); + return if2(streamp(obj), tnil(obj->co.ops == &cat_stream_ops.cobj_ops)); } val catenated_stream_push(val new_stream, val cat_stream) @@ -424,7 +424,7 @@ static val wait_wrap(val pid, val flags) static val wifexited(val status) { int s = c_num(if3(consp(status), cdr(status), status)); - return c_true(WIFEXITED(s)); + return tnil(WIFEXITED(s)); } static val wexitstatus(val status) @@ -436,7 +436,7 @@ static val wexitstatus(val status) static val wifsignaled(val status) { int s = c_num(if3(consp(status), cdr(status), status)); - return c_true(WIFSIGNALED(s)); + return tnil(WIFSIGNALED(s)); } static val wtermsig(val status) @@ -449,14 +449,14 @@ static val wtermsig(val status) static val wcoredump(val status) { int s = c_num(if3(consp(status), cdr(status), status)); - return c_true(WCOREDUMP(s)); + return tnil(WCOREDUMP(s)); } #endif static val wifstopped(val status) { int s = c_num(if3(consp(status), cdr(status), status)); - return c_true(WIFSTOPPED(s)); + return tnil(WIFSTOPPED(s)); } static val wstopsig(val status) @@ -469,7 +469,7 @@ static val wstopsig(val status) static val wifcontinued(val status) { int s = c_num(if3(consp(status), cdr(status), status)); - return c_true(WIFCONTINUED(s)); + return tnil(WIFCONTINUED(s)); } #endif |