summaryrefslogtreecommitdiff
path: root/libguile/goops.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2015-01-06 13:41:56 -0500
committerAndy Wingo <wingo@pobox.com>2015-01-23 16:16:00 +0100
commit6c7dd9ebd3702c71adf5dcce9509294ebb52f226 (patch)
treeaa84e17a3a3de1aa01efcd67225c178417810aab /libguile/goops.h
parent9e2cd55ec818fad72e99a0295fbbff3cfca7ff0c (diff)
downloadguile-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/goops.h')
-rw-r--r--libguile/goops.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/libguile/goops.h b/libguile/goops.h
index bc6524cbe..062a7b8ba 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -137,19 +137,6 @@
#define SCM_SET_CLASS_DESTRUCTOR(c, d) SCM_SET_VTABLE_DESTRUCTOR (c, d)
-#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_si_dispatch_procedure scm_applicable_struct_index_procedure /* 0 */
-#define scm_si_methods 1
-#define scm_si_n_specialized 2
-#define scm_si_extended_by 3
-#define scm_si_effective_methods 4
-#define scm_si_generic_setter 5
-
/* C interface */
SCM_API SCM scm_class_boolean;
SCM_API SCM scm_class_char;
@@ -220,7 +207,6 @@ SCM_INTERNAL SCM scm_make_standard_class (SCM meta, SCM name, SCM dsupers,
/* Primitives exported */
SCM_API SCM scm_sys_allocate_instance (SCM c, SCM initargs);
-SCM_API SCM scm_sys_set_object_setter_x (SCM obj, SCM setter);
SCM_API SCM scm_slot_ref (SCM obj, SCM slot_name);
SCM_API SCM scm_slot_set_x (SCM obj, SCM slot_name, SCM value);