mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
* load.c (load): Use `scm_selected_module' to compute second arg
to new scm_i_eval_x; Don't call it if module system hasn't booted. (scm_read_and_eval_x): Deprecated. #include "modules.h".
This commit is contained in:
parent
238d517c09
commit
f33b174d0e
1 changed files with 15 additions and 5 deletions
|
@ -55,6 +55,7 @@
|
||||||
#include "libguile/dynwind.h"
|
#include "libguile/dynwind.h"
|
||||||
#include "libguile/root.h"
|
#include "libguile/root.h"
|
||||||
#include "libguile/strings.h"
|
#include "libguile/strings.h"
|
||||||
|
#include "libguile/modules.h"
|
||||||
|
|
||||||
#include "libguile/validate.h"
|
#include "libguile/validate.h"
|
||||||
#include "libguile/load.h"
|
#include "libguile/load.h"
|
||||||
|
@ -94,7 +95,14 @@ load (void *data)
|
||||||
SCM form = scm_read (port);
|
SCM form = scm_read (port);
|
||||||
if (SCM_EOF_OBJECT_P (form))
|
if (SCM_EOF_OBJECT_P (form))
|
||||||
break;
|
break;
|
||||||
scm_eval_x (form);
|
/* Ugh! We need to re-check the environment for every form.
|
||||||
|
* We should change this in the new module system.
|
||||||
|
*/
|
||||||
|
scm_i_eval_x (form,
|
||||||
|
scm_module_system_booted_p
|
||||||
|
? (scm_top_level_env
|
||||||
|
(SCM_MODULE_EVAL_CLOSURE (scm_selected_module ())))
|
||||||
|
: SCM_EOL);
|
||||||
}
|
}
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
|
@ -451,9 +459,9 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 1, 0, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
/* The following function seems trivial - and indeed it is. Its
|
#if SCM_DEBUG_DEPRECATED == 0
|
||||||
* existence is motivated by its ability to evaluate expressions
|
|
||||||
* without copying them first (as is done in "eval").
|
/* Eval now copies source properties, so this function is no longer required.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SCM_SYMBOL (scm_end_of_file_key, "end-of-file");
|
SCM_SYMBOL (scm_end_of_file_key, "end-of-file");
|
||||||
|
@ -469,10 +477,12 @@ SCM_DEFINE (scm_read_and_eval_x, "read-and-eval!", 0, 1, 0,
|
||||||
SCM form = scm_read (port);
|
SCM form = scm_read (port);
|
||||||
if (SCM_EOF_OBJECT_P (form))
|
if (SCM_EOF_OBJECT_P (form))
|
||||||
scm_ithrow (scm_end_of_file_key, SCM_EOL, 1);
|
scm_ithrow (scm_end_of_file_key, SCM_EOL, 1);
|
||||||
return scm_eval_x (form);
|
return scm_eval_x (form, scm_selected_module ());
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Information about the build environment. */
|
/* Information about the build environment. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue