diff options
author | Andy Wingo <wingo@pobox.com> | 2015-01-06 13:41:56 -0500 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2015-01-23 16:16:00 +0100 |
commit | 6c7dd9ebd3702c71adf5dcce9509294ebb52f226 (patch) | |
tree | aa84e17a3a3de1aa01efcd67225c178417810aab /libguile/procs.c | |
parent | 9e2cd55ec818fad72e99a0295fbbff3cfca7ff0c (diff) | |
download | guile-6c7dd9ebd3702c71adf5dcce9509294ebb52f226.tar.gz |
Generics with setters have <applicable-struct-with-setter> layout
* libguile/goops.c (scm_sys_set_object_setter_x): Remove. Instead, we
use slot-set! of 'setter.
(scm_i_define_class_for_vtable): Move lower in the file, and fold in
scm_make_extended_class_from_symbol and make_class_from_symbol.
Properly handle applicable structs with setters.
(scm_class_applicable_struct_with_setter_class): New private capture.
(scm_sys_bless_applicable_struct_vtables_x): Rename to take two
arguments, and bless the second argument as an applicable struct with
setter vtable.
(scm_sys_goops_early_init): Capture setter classes.
* libguile/deprecated.c (SPEC_OF, CPL_OF): Access slots by name, not by
index.
(applicablep, more_specificp): Adapt to use CPL_OF.
(scm_find_method): Access "methods" slot by name.
* libguile/procs.c (scm_setter): Remove special case for generics; if
it's a setter, it will be a normal applicable struct.
* module/oop/goops.scm (<applicable-struct-with-setter-class>)
(<applicable-struct-with-setter>): New classes.
(<generic-with-setter>): Now an instance of the setter metaclass and a
child of the setter class, so that the "setter" slot ends up in the
right place.
(<accessor>, <extended-generic-with-setter>, <extended-accessor>): Be
instances of the setter metaclass.
(<method>, <accessor-method>): Move definitions farther down.
(make): Use slot-set! when initializing setters here.
(initialize): Likewise for <applicable-struct-with-setter>. Remove
specialization for <generic-with-setter>.
Diffstat (limited to 'libguile/procs.c')
-rw-r--r-- | libguile/procs.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/libguile/procs.c b/libguile/procs.c index be9f22035..08c5c355e 100644 --- a/libguile/procs.c +++ b/libguile/procs.c @@ -117,10 +117,6 @@ SCM_PRIMITIVE_GENERIC (scm_setter, "setter", 1, 0, 0, return scm_wta_dispatch_1 (g_scm_setter, proc, SCM_ARG1, FUNC_NAME); if (SCM_STRUCT_SETTER_P (proc)) return SCM_STRUCT_SETTER (proc); - if (SCM_PUREGENERICP (proc) - && SCM_IS_A_P (proc, scm_class_generic_with_setter)) - /* FIXME: might not be an accessor */ - return SCM_GENERIC_SETTER (proc); return scm_wta_dispatch_1 (g_scm_setter, proc, SCM_ARG1, FUNC_NAME); } #undef FUNC_NAME |