summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-05 22:53:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-05 22:53:59 -0700
commit1a18cf60f6f675fc6e0508cae87c4990706046e8 (patch)
tree6ef033de3ca830ac27fd4fdc46ad7f908ac197a6 /lib.c
parent0dc63a9258e21d09783f02b89e9b1ab1abbee7eb (diff)
downloadtxr-1a18cf60f6f675fc6e0508cae87c4990706046e8.tar.gz
txr-1a18cf60f6f675fc6e0508cae87c4990706046e8.tar.bz2
txr-1a18cf60f6f675fc6e0508cae87c4990706046e8.zip
lib: get rid of preprocessor macros for packages.
The identifiers user_package, system_package and keyword_package are preprocessor symbols that expand to other preprocessor symbols for no good reason. Time to get rid of this. * lib.c (system_package_var, keyword_package_var, user_package_var): Variables renamed to system_package, keyword_package and user_package. (symbol_package, keywordp, obj_init): Fix variable references to follow rename. * lib.h (keyword_package, user_package, system_package): Macros removed. (system_package_var, keyword_package_var, user_package_var): Variables renamed. * eval.c (eval_init): Fix variable references to follow rename. * parser.y (sym_helper): Likewise.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib.c b/lib.c
index f2a62d11..e45cdafe 100644
--- a/lib.c
+++ b/lib.c
@@ -83,7 +83,7 @@ int async_sig_enabled = 0;
val packages;
-val system_package_var, keyword_package_var, user_package_var;
+val system_package, keyword_package, user_package;
val package_alist_s;
val package_s, system_package_s, keyword_package_s, user_package_s;
@@ -5117,7 +5117,7 @@ static void symbol_setname(val sym, val name)
val symbol_package(val sym)
{
if (sym == nil)
- return user_package_var;
+ return user_package;
type_check(sym, SYM);
return sym->s.package;
}
@@ -5635,7 +5635,7 @@ val symbolp(val sym)
val keywordp(val sym)
{
- return tnil(sym && symbolp(sym) && sym->s.package == keyword_package_var);
+ return tnil(sym && symbolp(sym) && sym->s.package == keyword_package);
}
val get_current_package(void)
@@ -10664,8 +10664,8 @@ static void obj_init(void)
* symbols.
*/
- protect(&packages, &system_package_var, &keyword_package_var,
- &user_package_var, &null_string, &nil_string,
+ protect(&packages, &system_package, &keyword_package,
+ &user_package, &null_string, &nil_string,
&null_list, &equal_f, &eq_f, &eql_f,
&car_f, &cdr_f, &null_f, &list_f,
&identity_f, &less_f, &greater_f, &prog_string, &env_list,