diff --git a/libguile/goops.c b/libguile/goops.c index 1f865767a..c343e3db2 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -1904,6 +1904,8 @@ clear_method_cache (SCM gf) { SCM cache = scm_make_method_cache (gf); SCM_SET_GENERIC_METHOD_CACHE (gf, cache); + SCM_SET_GENERIC_DISPATCH_PROCEDURE (gf, SCM_BOOL_F); + SCM_CLEAR_GENERIC_EFFECTIVE_METHODS (gf); } SCM_DEFINE (scm_sys_invalidate_method_cache_x, "%invalidate-method-cache!", 1, 0, 0, @@ -2575,12 +2577,10 @@ create_standard_classes (void) k_init_value, SCM_EOL), scm_from_locale_symbol ("%cache"), - scm_from_locale_symbol ("applicable-methods"), - scm_from_locale_symbol ("effective-method"), + scm_from_locale_symbol ("dispatch-procedure"), + scm_from_locale_symbol ("effective-methods"), SCM_UNDEFINED); - SCM setter_slots = scm_list_3 (scm_from_locale_symbol ("%setter-cache"), - scm_from_locale_symbol ("applicable-setter-methods"), - scm_from_locale_symbol ("effective-setter-method")); + SCM setter_slots = scm_list_1 (sym_setter); SCM egf_slots = scm_list_1 (scm_list_3 (scm_from_locale_symbol ("extends"), k_init_value, SCM_EOL)); diff --git a/libguile/goops.h b/libguile/goops.h index 8d5fdc609..df92c23c3 100644 --- a/libguile/goops.h +++ b/libguile/goops.h @@ -165,11 +165,15 @@ typedef struct scm_t_method { #define SCM_GENERIC_METHOD_CACHE(G) (SCM_PACK (SCM_STRUCT_DATA (G) [scm_si_generic_cache])) #define SCM_SET_GENERIC_METHOD_CACHE(G,C) (SCM_STRUCT_DATA (G) [scm_si_generic_cache] = SCM_UNPACK (C)) -#define SCM_GENERIC_SETTER(G) (SCM_PACK (SCM_STRUCT_DATA (G) [scm_si_generic_setter_cache])) -#define SCM_SET_GENERIC_SETTER(G,C) (SCM_STRUCT_DATA (G) [scm_si_generic_setter_cache] = SCM_UNPACK (C)) #define SCM_MCACHE_N_SPECIALIZED(C) SCM_CADDR (C) #define SCM_SET_MCACHE_N_SPECIALIZED(C, X) SCM_SETCAR (SCM_CDDR (C), X) +#define SCM_SET_GENERIC_DISPATCH_PROCEDURE(G,C) (SCM_STRUCT_SLOT_SET (G, scm_si_dispatch_procedure, (C))) +#define SCM_CLEAR_GENERIC_EFFECTIVE_METHODS(G) (SCM_STRUCT_SLOT_SET (G, scm_si_effective_methods, SCM_EOL)); + +#define SCM_GENERIC_SETTER(G) (SCM_PACK (SCM_STRUCT_DATA (G) [scm_si_generic_setter])) +#define SCM_SET_GENERIC_SETTER(G,C) (SCM_STRUCT_DATA (G) [scm_si_generic_setter] = SCM_UNPACK (C)) + #define SCM_INITIAL_MCACHE_SIZE 1 #define scm_si_methods 0 /* offset of methods slot in a */ @@ -177,11 +181,9 @@ typedef struct scm_t_method { #define scm_si_cache_mutex 2 #define scm_si_extended_by 3 #define scm_si_generic_cache 4 -#define scm_si_applicable_methods 5 -#define scm_si_effective_method 6 -#define scm_si_generic_setter_cache 7 -#define scm_si_applicable_setter_methods 8 -#define scm_si_effective_setter_method 9 +#define scm_si_dispatch_procedure 5 +#define scm_si_effective_methods 6 +#define scm_si_generic_setter 7 #define scm_si_generic_function 0 /* offset of gf slot in a */ #define scm_si_specializers 1 /* offset of spec. slot in a */