@import-only updates the interaction-environment

This commit is contained in:
Alex Shinn 2011-11-06 15:59:46 +09:00
parent 731a6f6347
commit 05d87f0612

View file

@ -62,6 +62,8 @@
;;> the @scheme{escape:} keyword. The following commands are available: ;;> the @scheme{escape:} keyword. The following commands are available:
;;> ;;>
;;> @itemlist[ ;;> @itemlist[
;;> @item{@scheme|{@import <import-spec>}| - import the @var{<import-spec>} in the @scheme{interaction-environment}, useful if the @scheme{import} binding is not available}
;;> @item{@scheme|{@import-only <import-spec>}| - replace the @scheme{interaction-environment} with the given @var{<import-spec>}}
;;> @item{@scheme|{@in [<module>]}| - switch to @var{<module>}, or the @scheme{interaction-environment} if @var{<module>} is not specified} ;;> @item{@scheme|{@in [<module>]}| - switch to @var{<module>}, or the @scheme{interaction-environment} if @var{<module>} is not specified}
;;> @item{@scheme|{@meta <expr>}| - evaluate @var{<expr>} in the @scheme{(meta)} module} ;;> @item{@scheme|{@meta <expr>}| - evaluate @var{<expr>} in the @scheme{(meta)} module}
;;> @item{@scheme|{@meta-module-is <module>}| - switch the meta module to @var{<module>}} ;;> @item{@scheme|{@meta-module-is <module>}| - switch the meta module to @var{<module>}}
@ -130,7 +132,9 @@
meta-env))) meta-env)))
(if (pair? mod+imps) (if (pair? mod+imps)
(let ((env (if (eq? op 'import-only) (let ((env (if (eq? op 'import-only)
(make-environment) (let ((env (make-environment)))
(interaction-environment env)
env)
env)) env))
(imp-env (imp-env
(vector-ref (vector-ref