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
commite4b68f7cb56360f58929ae0b5001a640c0e8fd6e (patch)
tree478924cf7ba022620276ee9f19bf221a5032da54
parent77a208a0bf026fe31b111c2bb43f744a5bacdbf4 (diff)
downloadtxr-e4b68f7cb56360f58929ae0b5001a640c0e8fd6e.tar.gz
txr-e4b68f7cb56360f58929ae0b5001a640c0e8fd6e.tar.bz2
txr-e4b68f7cb56360f58929ae0b5001a640c0e8fd6e.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);