diff options
Diffstat (limited to 'libguile/goops.c')
-rw-r--r-- | libguile/goops.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 9f6149171..f0a4315c1 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -2284,15 +2284,21 @@ SCM_DEFINE (scm_sys_method_more_specific_p, "%method-more-specific?", 3, 0, 0, * ******************************************************************************/ +/* Munge the CPL of C in place such that BEFORE appears before AFTER, + assuming that currently the reverse is true. Recalculate slots and + associated getters-n-setters. */ static void fix_cpl (SCM c, SCM before, SCM after) { SCM cpl = SCM_SLOT (c, scm_si_cpl); SCM ls = scm_c_memq (after, cpl); - SCM tail = scm_delq1_x (before, SCM_CDR (ls)); + SCM tail; + if (scm_is_false (ls)) /* if this condition occurs, fix_cpl should not be applied this way */ abort (); + + tail = scm_delq1_x (before, SCM_CDR (ls)); SCM_SETCAR (ls, before); SCM_SETCDR (ls, scm_cons (after, tail)); { @@ -2418,8 +2424,8 @@ create_standard_classes (void) make_stdcls (&scm_class_extended_generic_with_setter, "<extended-generic-with-setter>", scm_class_applicable_struct_class, - scm_list_2 (scm_class_generic_with_setter, - scm_class_extended_generic), + scm_list_2 (scm_class_extended_generic, + scm_class_generic_with_setter), SCM_EOL); SCM_SET_CLASS_FLAGS (scm_class_extended_generic_with_setter, SCM_CLASSF_PURE_GENERIC); @@ -2428,8 +2434,9 @@ create_standard_classes (void) scm_list_2 (scm_class_accessor, scm_class_extended_generic_with_setter), SCM_EOL); + /* <extended-generic> is misplaced. */ fix_cpl (scm_class_extended_accessor, - scm_class_extended_generic, scm_class_generic); + scm_class_extended_generic, scm_class_generic_with_setter); SCM_SET_CLASS_FLAGS (scm_class_extended_accessor, SCM_CLASSF_PURE_GENERIC); /* Primitive types classes */ |