[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 45/88: Remove scm_c_extend_primitive_generic
From: |
Andy Wingo |
Subject: |
[Guile-commits] 45/88: Remove scm_c_extend_primitive_generic |
Date: |
Fri, 23 Jan 2015 15:25:45 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 5a6165db6e32f7d54db39d9001add11a2f97ff5a
Author: Andy Wingo <address@hidden>
Date: Sat Jan 10 23:20:47 2015 +0100
Remove scm_c_extend_primitive_generic
* libguile/goops.h (scm_c_extend_primitive_generic): Remove public
interface. This was introduced in 2003 with the "extended" generics
but never documented, unused as far as I can tell, and is better
accessed from Scheme.
* libguile/goops.c: Remove support for scm_c_extend_primitive_generic.
Simplify capture of change-class.
---
libguile/goops.c | 68 +-----------------------------------------------------
libguile/goops.h | 1 -
2 files changed, 1 insertions(+), 68 deletions(-)
diff --git a/libguile/goops.c b/libguile/goops.c
index 34d12cd..5f9fcac 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -90,12 +90,6 @@ static SCM var_slot_set_x = SCM_BOOL_F;
static SCM var_slot_bound_p = SCM_BOOL_F;
static SCM var_slot_exists_p = SCM_BOOL_F;
-
-SCM_SYMBOL (sym_change_class, "change-class");
-
-SCM_VARIABLE (scm_var_make_extended_generic, "make-extended-generic");
-
-
#define SCM_GOOPS_UNBOUND SCM_UNBOUND
#define SCM_GOOPS_UNBOUNDP(x) (scm_is_eq (x, SCM_GOOPS_UNBOUND))
@@ -822,8 +816,6 @@ go_to_heaven (void *o)
}
-SCM_SYMBOL (scm_sym_change_class, "change-class");
-
static SCM
purgatory (SCM obj, SCM new_class)
{
@@ -924,62 +916,6 @@ SCM_DEFINE (scm_primitive_generic_generic,
"primitive-generic-generic", 1, 0, 0,
}
#undef FUNC_NAME
-typedef struct t_extension {
- struct t_extension *next;
- SCM extended;
- SCM extension;
-} t_extension;
-
-
-/* Hint for `scm_gc_malloc ()' et al. when allocating `t_extension'
- objects. */
-static const char extension_gc_hint[] = "GOOPS extension";
-
-static t_extension *extensions = 0;
-
-void
-scm_c_extend_primitive_generic (SCM extended, SCM extension)
-{
- if (goops_loaded_p)
- {
- SCM gf, gext;
- if (!SCM_UNPACK (*SCM_SUBR_GENERIC (extended)))
- scm_enable_primitive_generic_x (scm_list_1 (extended));
- gf = *SCM_SUBR_GENERIC (extended);
- gext = scm_call_2 (SCM_VARIABLE_REF (scm_var_make_extended_generic),
- gf,
- SCM_SUBR_NAME (extension));
- SCM_SET_SUBR_GENERIC (extension, gext);
- }
- else
- {
- t_extension *e = scm_gc_malloc (sizeof (t_extension),
- extension_gc_hint);
- t_extension **loc = &extensions;
- /* Make sure that extensions are placed before their own
- * extensions in the extensions list. O(N^2) algorithm, but
- * extensions of primitive generics are rare.
- */
- while (*loc && !scm_is_eq (extension, (*loc)->extended))
- loc = &(*loc)->next;
- e->next = *loc;
- e->extended = extended;
- e->extension = extension;
- *loc = e;
- }
-}
-
-static void
-setup_extended_primitive_generics ()
-{
- while (extensions)
- {
- t_extension *e = extensions;
- scm_c_extend_primitive_generic (e->extended, e->extension);
- extensions = e->next;
- }
-}
-
/* Dirk:FIXME:: In all of these scm_wta_dispatch_* routines it is
* assumed that 'gf' is zero if uninitialized. It would be cleaner if
* some valid SCM value like SCM_BOOL_F or SCM_UNDEFINED were chosen.
@@ -1415,9 +1351,7 @@ SCM_DEFINE (scm_sys_goops_loaded, "%goops-loaded", 0, 0,
0,
var_method_specializers = scm_c_lookup ("method-specializers");
var_method_procedure = scm_c_lookup ("method-procedure");
- var_change_class =
- scm_module_variable (scm_module_goops, sym_change_class);
- setup_extended_primitive_generics ();
+ var_change_class = scm_c_lookup ("change-class");
#if (SCM_ENABLE_DEPRECATED == 1)
scm_init_deprecated_goops ();
diff --git a/libguile/goops.h b/libguile/goops.h
index 29aa80d..4550baa 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -167,7 +167,6 @@ SCM_API SCM scm_generic_capability_p (SCM proc);
SCM_API SCM scm_enable_primitive_generic_x (SCM subrs);
SCM_INTERNAL SCM scm_set_primitive_generic_x (SCM subr, SCM generic);
SCM_API SCM scm_primitive_generic_generic (SCM subr);
-SCM_API void scm_c_extend_primitive_generic (SCM subr, SCM extension);
SCM_API SCM stklos_version (void);
SCM_API SCM scm_make (SCM args);
SCM_API void scm_change_object_class (SCM, SCM, SCM);
- [Guile-commits] 21/88: Remove unreachable code in scm_setter, (continued)
- [Guile-commits] 21/88: Remove unreachable code in scm_setter, Andy Wingo, 2015/01/23
- [Guile-commits] 18/88: Fold GOOPS compile and dispatch modules into main GOOPS module, Andy Wingo, 2015/01/23
- [Guile-commits] 39/88: Port method and generic accessors to Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 35/88: Refactor to <class> slot computation, Andy Wingo, 2015/01/23
- [Guile-commits] 38/88: <class> accessors implemented in Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 30/88: Remove private var_no_applicable_method capture, Andy Wingo, 2015/01/23
- [Guile-commits] 26/88: Deprecate C exports of GOOPS classes., Andy Wingo, 2015/01/23
- [Guile-commits] 41/88: Goops slot-unbound / slot-missing cleanups, Andy Wingo, 2015/01/23
- [Guile-commits] 40/88: Move slot-ref et al to Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 44/88: No more concept of "pure generics", Andy Wingo, 2015/01/23
- [Guile-commits] 45/88: Remove scm_c_extend_primitive_generic,
Andy Wingo <=
- [Guile-commits] 47/88: Rewrite %initialize-object in Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 48/88: Deprecate scm_get_keyword, Andy Wingo, 2015/01/23
- [Guile-commits] 43/88: Remove TEST_CHANGE_CLASS, Andy Wingo, 2015/01/23
- [Guile-commits] 42/88: Remove pure-generic?, Andy Wingo, 2015/01/23
- [Guile-commits] 46/88: Minor goops.c tidying, Andy Wingo, 2015/01/23
- [Guile-commits] 37/88: goops: use computed class slot offsets; untabify and fix whitepace, Andy Wingo, 2015/01/23
- [Guile-commits] 50/88: Re-use the vtable "size" field for GOOPS nfields, Andy Wingo, 2015/01/23
- [Guile-commits] 52/88: Reimplement inherit-applicable! in Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 54/88: Incorporate %inherit-magic! into %init-layout!, Andy Wingo, 2015/01/23
- [Guile-commits] 49/88: Move <class> initialization to Scheme, Andy Wingo, 2015/01/23