mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
* goops.c (scm_add_method, DEFVAR): Use scm_eval instead of
scm_i_eval. (make_class_from_template): Do not bother to set the current module around the call to DEFVAR, scm_eval takes care of that. (scm_init_goops): Make scm_module_goops and scm_goops_lookup_closure permanent objects.
This commit is contained in:
parent
f1b7a06676
commit
0ba8a0a583
1 changed files with 9 additions and 13 deletions
|
@ -75,8 +75,8 @@
|
|||
#define SPEC_OF(x) SCM_SLOT (x, scm_si_specializers)
|
||||
|
||||
#define DEFVAR(v,val) \
|
||||
{ scm_i_eval (SCM_LIST3 (scm_sym_define_public, (v), (val)), \
|
||||
scm_top_level_env (scm_goops_lookup_closure)); }
|
||||
{ scm_eval (SCM_LIST3 (scm_sym_define_public, (v), (val)), \
|
||||
scm_module_goops); }
|
||||
/* Temporary hack until we get the new module system */
|
||||
/*fixme* Should optimize by keeping track of the variable object itself */
|
||||
#define GETVAR(v) (SCM_CDDR (scm_apply (scm_goops_lookup_closure, \
|
||||
|
@ -2326,15 +2326,7 @@ make_class_from_template (char *template, char *type_name, SCM supers)
|
|||
&& SCM_FALSEP (scm_apply (scm_goops_lookup_closure,
|
||||
SCM_LIST2 (name, SCM_BOOL_F),
|
||||
SCM_EOL)))
|
||||
{
|
||||
/* Make sure we add the binding in the GOOPS module.
|
||||
* This kludge is needed until DEFVAR ceases to use `define-public'
|
||||
* or `define-public' ceases to use `current-module'.
|
||||
*/
|
||||
SCM old_module = scm_set_current_module (scm_module_goops);
|
||||
DEFVAR (name, class);
|
||||
scm_set_current_module (old_module);
|
||||
}
|
||||
DEFVAR (name, class);
|
||||
return class;
|
||||
}
|
||||
|
||||
|
@ -2594,8 +2586,7 @@ SCM_SYMBOL (sym_internal_add_method_x, "internal-add-method!");
|
|||
void
|
||||
scm_add_method (SCM gf, SCM m)
|
||||
{
|
||||
scm_i_eval (SCM_LIST3 (sym_internal_add_method_x, gf, m),
|
||||
scm_top_level_env (scm_goops_lookup_closure));
|
||||
scm_eval (SCM_LIST3 (sym_internal_add_method_x, gf, m), scm_module_goops);
|
||||
}
|
||||
|
||||
#ifdef GUILE_DEBUG
|
||||
|
@ -2645,6 +2636,11 @@ scm_init_goops (void)
|
|||
|
||||
scm_goops_lookup_closure = scm_module_lookup_closure (scm_module_goops);
|
||||
|
||||
/* Not really necessary right now, but who knows...
|
||||
*/
|
||||
scm_permanent_object (scm_module_goops);
|
||||
scm_permanent_object (scm_goops_lookup_closure);
|
||||
|
||||
scm_components = scm_permanent_object (scm_make_weak_key_hash_table
|
||||
(SCM_MAKINUM (37)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue