summaryrefslogtreecommitdiff
path: root/libguile/vm.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-05-23 11:46:30 +0200
committerAndy Wingo <wingo@pobox.com>2012-05-23 11:49:16 +0200
commit62e15979b5d773dda79c4f44c07e919b5d0f6e18 (patch)
tree6df6724acbac08a6fb1baa6736d1687e84e75f3a /libguile/vm.c
parent15bb587f45b718f08756993fec9274212cc7df58 (diff)
downloadguile-62e15979b5d773dda79c4f44c07e919b5d0f6e18.tar.gz
deprecate scm_sym2var
* libguile/deprecated.h: * libguile/deprecated.c (scm_sym2var): Deprecate this function. * libguile/modules.h: * libguile/modules.c (scm_module_ensure_local_variable): New public function, replacing scm_sym2var with a true definep, without going through eval closures (which are deprecated). (scm_current_module): Rework to do something sensible before modules are booted. (scm_module_lookup, scm_lookup): Refactor to use scm_module_variable. (scm_module_define, scm_define): Refactor to use scm_module_ensure_local_variable. * libguile/vm-i-system.c (define!): Use scm_define. * libguile/vm.c (resolve_variable): Use scm_module_lookup. * libguile/macros.c (scm_make_syntax_transformer): Use scm_module_variable. * libguile/gdbint.c (gdb_binding): Use scm_define. * doc/ref/api-modules.texi (Accessing Modules from C): Add docs for scm_module_ensure_local_variable.
Diffstat (limited to 'libguile/vm.c')
-rw-r--r--libguile/vm.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libguile/vm.c b/libguile/vm.c
index db5e58ca0..5dec106a5 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -610,17 +610,10 @@ resolve_variable (SCM what, SCM program_module)
{
if (SCM_LIKELY (scm_is_symbol (what)))
{
- if (SCM_LIKELY (scm_is_true (program_module)))
- /* might longjmp */
+ if (scm_is_true (program_module))
return scm_module_lookup (program_module, what);
else
- {
- SCM v = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
- if (scm_is_false (v))
- scm_misc_error (NULL, "unbound variable: ~S", scm_list_1 (what));
- else
- return v;
- }
+ return scm_module_lookup (scm_the_root_module (), what);
}
else
{