summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-06 07:06:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-09 15:51:24 -0700
commit23f5371c462e933102e6c4048dded8d9c5811f73 (patch)
treeaa4e5bb9c3bd661ffb32a3820a80c680d1924faf /eval.c
parent8a9159263d4ca1b174a60476e3863c45d9e63cc1 (diff)
downloadtxr-23f5371c462e933102e6c4048dded8d9c5811f73.tar.gz
txr-23f5371c462e933102e6c4048dded8d9c5811f73.tar.bz2
txr-23f5371c462e933102e6c4048dded8d9c5811f73.zip
Application code is now in a package called pub.
* lib.c (public_package): New variable. (obj_init): Protect public_package from gc. Initialize it with a package called "pub" which has the user package in its fallback list. * lib.h (public_package): Declared. * eval.c (eval_init): Initialize package_s to public_package rather than user_package, except in compat <= 190 mode. * txr.c (txr_main): Bind *package* to public_package rather than user_package, except in compat <= 190 mode.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index fb310f44..a41d362a 100644
--- a/eval.c
+++ b/eval.c
@@ -6453,7 +6453,8 @@ void eval_init(void)
reg_fun(intern(lit("gensym"), user_package), func_n1o(gensym, 0));
reg_var(gensym_counter_s = intern(lit("*gensym-counter*"), user_package), zero);
reg_var(package_alist_s = intern(lit("*package-alist*"), user_package), packages);
- reg_var(package_s = intern(lit("*package*"), user_package), user_package);
+ reg_var(package_s = intern(lit("*package*"), user_package),
+ (opt_compat && opt_compat <= 190) ? user_package : public_package);
reg_fun(intern(lit("make-package"), user_package), func_n1(make_package));
reg_fun(intern(lit("find-package"), user_package), func_n1(find_package));
reg_fun(intern(lit("delete-package"), user_package), func_n1(delete_package));