summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-22 10:04:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-22 10:04:06 -0800
commit7c010ed8ec8d733f5c6764c32691a33da51240bc (patch)
tree478924cf7ba022620276ee9f19bf221a5032da54
parentc2906d9e4e686a7ee34bc47200d391ca88307755 (diff)
downloadtxr-7c010ed8ec8d733f5c6764c32691a33da51240bc.tar.gz
txr-7c010ed8ec8d733f5c6764c32691a33da51240bc.tar.bz2
txr-7c010ed8ec8d733f5c6764c32691a33da51240bc.zip
Dynamically rebind *package* in @(load).
* match.c (v_load): Re-bind the *package* variable in the new dynamic scope to its current value, so that any modifications to it by the loaded code are thrown away, just like in the Lisp load function.
-rw-r--r--match.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/match.c b/match.c
index a97a2b65..3d334deb 100644
--- a/match.c
+++ b/match.c
@@ -3995,6 +3995,7 @@ static val v_load(match_files_ctx *c)
dyn_env = make_env(nil, nil, dyn_env);
env_vbind(dyn_env, load_path_s, name);
env_vbind(dyn_env, load_recursive_s, t);
+ env_vbind(dyn_env, package_s, cur_package);
if (!txr_lisp_p) {
int gc = gc_state(0);