diff options
author | Andy Wingo <wingo@pobox.com> | 2009-11-01 19:46:27 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-11-15 20:28:11 +0100 |
commit | 11561496bad94481cc2b3d8acba1a154e3c052fc (patch) | |
tree | 53e274a64e90105150c75d41b5c2358dcc545ba5 /libguile/objects.c | |
parent | 521ac49bdea053227c973a92e37fcc0879fa20d0 (diff) | |
download | guile-11561496bad94481cc2b3d8acba1a154e3c052fc.tar.gz |
remove support for "entities" -- a form of applicable struct
Entities were meant to be a form of applicable struct. Unfortunately,
the implementation is intertwingled with generics. Removing them, for
now, will make it possible to cleanly re-add applicable struct support.
* libguile/struct.h (SCM_STRUCTF_ENTITY): Remove.
(SCM_STRUCTF_GOOPS_HACK): New flag; sigh.
* libguile/struct.c (scm_make_struct): We make "entity" structs if the
GOOPS_HACK flag is set. This will be fixed when we rework flags and
remove hidden words.
* libguile/goops.c (scm_class_of): Structs are not applicable, for now
at least.
(scm_sys_inherit_magic_x, scm_basic_basic_make_class)
(scm_sys_allocate_instance, scm_sys_set_object_setter_x):
(make_struct_class): Adapt for no more entities (and thus no entity
flag).
(create_standard_classes): For some reason, generic functions were
getting the LIGHT flag set, after the ENTITY flag was removed; so for
now explicitly clear that flag.
* libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New
macros.
* libguile/objects.h:
* libguile/objects.c: Remove code for entities.
* libguile/debug.c: (scm_procedure_source): Only work with generics.
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
(scm_trampoline_2): Only handle generics.
* libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities.
* libguile/procprop.c (scm_i_procedure_arity): Remove support for
entities.
* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove
entity support.
Diffstat (limited to 'libguile/objects.c')
-rw-r--r-- | libguile/objects.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/libguile/objects.c b/libguile/objects.c index 81b941cf4..99aa6617d 100644 --- a/libguile/objects.c +++ b/libguile/objects.c @@ -199,78 +199,9 @@ scm_call_generic_3 (SCM gf, SCM a1, SCM a2, SCM a3) return scm_apply_generic (gf, scm_list_3 (a1, a2, a3)); } -SCM_DEFINE (scm_entity_p, "entity?", 1, 0, 0, - (SCM obj), - "Return @code{#t} if @var{obj} is an entity.") -#define FUNC_NAME s_scm_entity_p -{ - return scm_from_bool(SCM_STRUCTP (obj) && SCM_I_ENTITYP (obj)); -} -#undef FUNC_NAME - -/* XXX - What code requires the object procedure to be only of certain - types? */ - -SCM_DEFINE (scm_valid_object_procedure_p, "valid-object-procedure?", 1, 0, 0, - (SCM proc), - "Return @code{#t} iff @var{proc} is a procedure that can be used " - "with @code{set-object-procedure}. It is always valid to use " - "a closure constructed by @code{lambda}.") -#define FUNC_NAME s_scm_valid_object_procedure_p -{ - if (SCM_IMP (proc)) - return SCM_BOOL_F; - switch (SCM_TYP7 (proc)) - { - default: - return SCM_BOOL_F; - case scm_tcs_closures: - case scm_tc7_subr_1: - case scm_tc7_subr_2: - case scm_tc7_subr_3: - case scm_tc7_lsubr_2: - return SCM_BOOL_T; - } -} -#undef FUNC_NAME - -SCM_DEFINE (scm_set_object_procedure_x, "set-object-procedure!", 2, 0, 0, - (SCM obj, SCM proc), - "Set the object procedure of @var{obj} to @var{proc}.\n" - "@var{obj} must be an entity.") -#define FUNC_NAME s_scm_set_object_procedure_x -{ - SCM_ASSERT (SCM_STRUCTP (obj) - && (SCM_I_ENTITYP (obj) - && !(SCM_OBJ_CLASS_FLAGS (obj) - & SCM_CLASSF_PURE_GENERIC)), - obj, - SCM_ARG1, - FUNC_NAME); - SCM_SET_ENTITY_PROCEDURE (obj, proc); - return SCM_UNSPECIFIED; -} -#undef FUNC_NAME - -#define SCM_METACLASS_STANDARD_LAYOUT "" - void scm_init_objects () { - SCM ms = scm_from_locale_string (SCM_METACLASS_STANDARD_LAYOUT); - SCM mt = scm_make_vtable_vtable (ms, SCM_INUM0, - scm_list_3 (SCM_BOOL_F, SCM_EOL, SCM_EOL)); - - SCM es = scm_from_locale_string (SCM_ENTITY_LAYOUT); - SCM el = scm_make_struct_layout (es); - SCM et = scm_make_struct (mt, SCM_INUM0, - scm_list_4 (el, SCM_BOOL_F, SCM_EOL, SCM_EOL)); - - scm_c_define ("<class>", mt); - scm_metaclass_standard = mt; - SCM_SET_CLASS_FLAGS (et, SCM_CLASSF_ENTITY); - scm_c_define ("<entity>", et); - #include "libguile/objects.x" } |