diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-22 10:04:06 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-22 10:04:06 -0800 |
commit | 7c010ed8ec8d733f5c6764c32691a33da51240bc (patch) | |
tree | 478924cf7ba022620276ee9f19bf221a5032da54 | |
parent | c2906d9e4e686a7ee34bc47200d391ca88307755 (diff) | |
download | txr-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |