mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 17:20:29 +02:00
* objects.h (scm_si_redefined, scm_si_hashsets): Shifted.
* objects.h (SCM_OPERATOR_SETTER, SCM_ENTITY_SETTER): New macros. (struct scm_metaclass_operator): New setter slot. * objects.h (SCM_OBJ_CLASS_REDEF): New macro: Find class slots directly through the instance. * objects.c, objects.h (scm_class_of, scm_class_procedure_with_setter): Added. * objects.c, objects.h (SCM_CLASS_REDEF): Renamed from CLASS_REDEF.
This commit is contained in:
parent
ab7288bca0
commit
dae5a1e96f
1 changed files with 23 additions and 1 deletions
|
@ -89,6 +89,7 @@
|
|||
#define SCM_OPERATOR_PROC_1(obj) (SCM_OBJ_OPERATOR_CLASS (obj)->proc1)
|
||||
#define SCM_OPERATOR_PROC_2(obj) (SCM_OBJ_OPERATOR_CLASS (obj)->proc2)
|
||||
#define SCM_OPERATOR_PROC_3(obj) (SCM_OBJ_OPERATOR_CLASS (obj)->proc3)
|
||||
#define SCM_OPERATOR_SETTER(obj) (SCM_OBJ_OPERATOR_CLASS (obj)->setter)
|
||||
|
||||
#define SCM_I_ENTITYP(obj)\
|
||||
((SCM_OBJ_CLASS_FLAGS (obj) & SCM_CLASSF_ENTITY) != 0)
|
||||
|
@ -96,6 +97,7 @@
|
|||
#define SCM_ENTITY_PROC_1(obj) (SCM_STRUCT_DATA (obj)[scm_struct_i_proc + 1])
|
||||
#define SCM_ENTITY_PROC_2(obj) (SCM_STRUCT_DATA (obj)[scm_struct_i_proc + 2])
|
||||
#define SCM_ENTITY_PROC_3(obj) (SCM_STRUCT_DATA (obj)[scm_struct_i_proc + 3])
|
||||
#define SCM_ENTITY_SETTER(obj) (SCM_STRUCT_DATA (obj)[scm_struct_i_setter])
|
||||
|
||||
/* {Operator classes}
|
||||
*
|
||||
|
@ -137,7 +139,7 @@ struct scm_metaclass_standard {
|
|||
SCM print;
|
||||
};
|
||||
|
||||
#define SCM_METACLASS_OPERATOR_LAYOUT "popopopo"
|
||||
#define SCM_METACLASS_OPERATOR_LAYOUT "popopopopo"
|
||||
struct scm_metaclass_operator {
|
||||
SCM layout;
|
||||
SCM vcell;
|
||||
|
@ -147,6 +149,7 @@ struct scm_metaclass_operator {
|
|||
SCM proc1;
|
||||
SCM proc2;
|
||||
SCM proc3;
|
||||
SCM setter;
|
||||
};
|
||||
|
||||
/* {Entity classes}
|
||||
|
@ -159,9 +162,28 @@ struct scm_metaclass_operator {
|
|||
*/
|
||||
#define SCM_ENTITY_LAYOUT ""
|
||||
|
||||
/* The following three definitions are Goops dependencies needed by
|
||||
scm_class_of. */
|
||||
#define SCM_CLASSF_GOOPS (0x10 << 24)
|
||||
#define scm_si_redefined 18
|
||||
#define scm_si_hashsets 20
|
||||
#define SCM_CLASS_OF(x) SCM_STRUCT_VTABLE (x)
|
||||
|
||||
#define SCM_OBJ_CLASS_REDEF(x) (SCM_STRUCT_VTABLE_DATA(x)[scm_si_redefined])
|
||||
|
||||
extern SCM scm_metaclass_standard;
|
||||
extern SCM scm_metaclass_operator;
|
||||
extern SCM scm_class_boolean, scm_class_char, scm_class_pair;
|
||||
extern SCM scm_class_procedure, scm_class_string, scm_class_symbol;
|
||||
extern SCM scm_class_procedure_with_setter;
|
||||
extern SCM scm_class_vector, scm_class_null;
|
||||
extern SCM scm_class_real, scm_class_complex, scm_class_integer;
|
||||
extern SCM scm_class_keyword, scm_class_unknown;
|
||||
|
||||
extern void (*scm_change_object_class) (SCM, SCM, SCM);
|
||||
extern void (*scm_memoize_method) (SCM x, SCM args);
|
||||
|
||||
extern SCM scm_class_of (SCM obj);
|
||||
extern SCM scm_entity_p (SCM obj);
|
||||
extern SCM scm_set_object_procedure_x (SCM obj, SCM procs);
|
||||
extern SCM scm_make_class_object (SCM metaclass, SCM layout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue