1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

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.
This commit is contained in:
Andy Wingo 2012-05-23 11:46:30 +02:00
parent 15bb587f45
commit 62e15979b5
9 changed files with 132 additions and 97 deletions

View file

@ -1,5 +1,5 @@
/* GDB interface for Guile
* Copyright (C) 1996,1997,1999,2000,2001,2002,2004,2009,2011
* Copyright (C) 1996,1997,1999,2000,2001,2002,2004,2009,2011,2012
* Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
@ -234,8 +234,7 @@ gdb_binding (SCM name, SCM value)
}
SCM_BEGIN_FOREIGN_BLOCK;
{
SCM var = scm_sym2var (name, SCM_TOP_LEVEL_LOOKUP_CLOSURE, SCM_BOOL_T);
SCM_VARIABLE_SET (var, value);
scm_define (name, value);
}
SCM_END_FOREIGN_BLOCK;
return 0;