[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 19/61: No more concept of "pure generics"
From: |
Andy Wingo |
Subject: |
[Guile-commits] 19/61: No more concept of "pure generics" |
Date: |
Thu, 22 Jan 2015 18:53:04 +0000 |
wingo pushed a commit to branch wip-goops-refactor
in repository guile.
commit 07557d8026923fa6352f9e49666385241ccd7f53
Author: Andy Wingo <address@hidden>
Date: Sat Jan 10 23:02:02 2015 +0100
No more concept of "pure generics"
* libguile/goops.h (SCM_PUREGENERICP, SCM_VALIDATE_PUREGENERIC)
(SCM_VTABLE_FLAG_GOOPS_PURE_GENERIC, SCM_CLASSF_PURE_GENERIC):
Remove.
* libguile/goops.c (scm_set_primitive_generic_x): Use SCM_GENERICP, not
SCM_PUREGENERICP.
(scm_sys_bless_pure_generic_vtable_x): Remove; this flag isn't
checked.
* module/oop/goops.scm: Don't call %bless-pure-generic-vtable!; there's
no need.
---
libguile/goops.c | 14 +-------------
libguile/goops.h | 6 ------
module/oop/goops.scm | 6 ------
3 files changed, 1 insertions(+), 25 deletions(-)
diff --git a/libguile/goops.c b/libguile/goops.c
index 8a8f8ac..34d12cd 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -157,7 +157,6 @@ static SCM scm_unbound_p (SCM obj);
static SCM scm_class_p (SCM obj);
static SCM scm_sys_bless_applicable_struct_vtables_x (SCM applicable,
SCM setter);
-static SCM scm_sys_bless_pure_generic_vtable_x (SCM vtable);
static SCM scm_sys_make_root_class (SCM name, SCM dslots,
SCM getters_n_setters);
static SCM scm_sys_init_layout_x (SCM class, SCM layout);
@@ -904,7 +903,7 @@ SCM_DEFINE (scm_set_primitive_generic_x,
"set-primitive-generic!", 2, 0, 0,
#define FUNC_NAME s_scm_set_primitive_generic_x
{
SCM_ASSERT (SCM_PRIMITIVE_GENERIC_P (subr), subr, SCM_ARG1, FUNC_NAME);
- SCM_ASSERT (SCM_PUREGENERICP (generic), generic, SCM_ARG2, FUNC_NAME);
+ SCM_ASSERT (SCM_GENERICP (generic), generic, SCM_ARG2, FUNC_NAME);
SCM_SET_SUBR_GENERIC (subr, generic);
return SCM_UNSPECIFIED;
}
@@ -1301,17 +1300,6 @@ SCM_DEFINE (scm_sys_bless_applicable_struct_vtables_x,
"%bless-applicable-struct
}
#undef FUNC_NAME
-SCM_DEFINE (scm_sys_bless_pure_generic_vtable_x,
"%bless-pure-generic-vtable!", 1, 0, 0,
- (SCM vtable),
- "")
-#define FUNC_NAME s_scm_sys_bless_pure_generic_vtable_x
-{
- SCM_VALIDATE_CLASS (1, vtable);
- SCM_SET_CLASS_FLAGS (vtable, SCM_CLASSF_PURE_GENERIC);
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
SCM_DEFINE (scm_sys_goops_early_init, "%goops-early-init", 0, 0, 0,
(),
"")
diff --git a/libguile/goops.h b/libguile/goops.h
index c5ed39f..29aa80d 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -42,7 +42,6 @@
*/
#define SCM_VTABLE_FLAG_GOOPS_CLASS SCM_VTABLE_FLAG_GOOPS_0
#define SCM_VTABLE_FLAG_GOOPS_VALID SCM_VTABLE_FLAG_GOOPS_1
-#define SCM_VTABLE_FLAG_GOOPS_PURE_GENERIC SCM_VTABLE_FLAG_GOOPS_2
#define SCM_CLASS_OF(x) SCM_STRUCT_VTABLE (x)
#define SCM_CLASS_FLAGS(class) (SCM_VTABLE_FLAGS (class))
@@ -51,7 +50,6 @@
#define SCM_CLEAR_CLASS_FLAGS(c, f) (SCM_CLEAR_VTABLE_FLAGS (c, f))
#define SCM_CLASSF_METACLASS
(SCM_VTABLE_FLAG_GOOPS_CLASS|SCM_VTABLE_FLAG_VTABLE)
-#define SCM_CLASSF_PURE_GENERIC SCM_VTABLE_FLAG_GOOPS_PURE_GENERIC
#define SCM_CLASSF_GOOPS_VALID SCM_VTABLE_FLAG_GOOPS_VALID
#define SCM_CLASSF_GOOPS SCM_VTABLE_FLAG_GOOPS_CLASS
#define SCM_CLASSF_GOOPS_OR_VALID (SCM_CLASSF_GOOPS | SCM_CLASSF_GOOPS_VALID)
@@ -97,10 +95,6 @@
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_GOOPS))
#define SCM_VALIDATE_INSTANCE(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x,
INSTANCEP, "instance")
-#define SCM_PUREGENERICP(x) \
- (SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_PURE_GENERIC))
-#define SCM_VALIDATE_PUREGENERIC(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x,
PUREGENERICP, "pure generic function")
-
#define SCM_SLOT(x, i) (SCM_STRUCT_SLOT_REF (x, i))
#define SCM_SET_SLOT(x, i, v) (SCM_STRUCT_SLOT_SET (x, i, v))
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index c7703ea..dcc9a45 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -530,26 +530,20 @@
(n-specialized #:init-value 0)
(extended-by #:init-value ())
effective-methods)
-(%bless-pure-generic-vtable! <generic>)
(define-standard-class <extended-generic> (<generic>)
#:metaclass <applicable-struct-class>
(extends #:init-value ()))
-(%bless-pure-generic-vtable! <extended-generic>)
(define-standard-class <generic-with-setter> (<generic>
<applicable-struct-with-setter>)
#:metaclass <applicable-struct-with-setter-class>)
-(%bless-pure-generic-vtable! <generic-with-setter>)
(define-standard-class <accessor> (<generic-with-setter>)
#:metaclass <applicable-struct-with-setter-class>)
-(%bless-pure-generic-vtable! <accessor>)
(define-standard-class <extended-generic-with-setter> (<extended-generic>
<generic-with-setter>)
#:metaclass <applicable-struct-with-setter-class>)
-(%bless-pure-generic-vtable! <extended-generic-with-setter>)
(define-standard-class <extended-accessor> (<accessor>
<extended-generic-with-setter>)
#:metaclass <applicable-struct-with-setter-class>)
-(%bless-pure-generic-vtable! <extended-accessor>)
;; Methods
(define-standard-class <method> (<object>)
- [Guile-commits] 20/61: Remove scm_c_extend_primitive_generic, (continued)
- [Guile-commits] 20/61: Remove scm_c_extend_primitive_generic, Andy Wingo, 2015/01/22
- [Guile-commits] 02/61: Remove hashset slots from GOOPS classes, Andy Wingo, 2015/01/22
- [Guile-commits] 05/61: Remove private var_no_applicable_method capture, Andy Wingo, 2015/01/22
- [Guile-commits] 11/61: Statically compute offsets for slots of <class> in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 10/61: Refactor to <class> slot computation, Andy Wingo, 2015/01/22
- [Guile-commits] 09/61: Remove GOOPS random state, Andy Wingo, 2015/01/22
- [Guile-commits] 23/61: Deprecate scm_get_keyword, Andy Wingo, 2015/01/22
- [Guile-commits] 18/61: Remove TEST_CHANGE_CLASS, Andy Wingo, 2015/01/22
- [Guile-commits] 17/61: Remove pure-generic?, Andy Wingo, 2015/01/22
- [Guile-commits] 25/61: Re-use the vtable "size" field for GOOPS nfields, Andy Wingo, 2015/01/22
- [Guile-commits] 19/61: No more concept of "pure generics",
Andy Wingo <=
- [Guile-commits] 15/61: Move slot-ref et al to Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 21/61: Minor goops.c tidying, Andy Wingo, 2015/01/22
- [Guile-commits] 01/61: Deprecate C exports of GOOPS classes., Andy Wingo, 2015/01/22
- [Guile-commits] 22/61: Rewrite %initialize-object in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 31/61: GOOPS cleanup to use SRFI-1 better, Andy Wingo, 2015/01/22
- [Guile-commits] 29/61: Incorporate %inherit-magic! into %init-layout!, Andy Wingo, 2015/01/22
- [Guile-commits] 32/61: append-map rather than mapappend, Andy Wingo, 2015/01/22
- [Guile-commits] 24/61: Move <class> initialization to Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 30/61: Cosmetic goops refactors., Andy Wingo, 2015/01/22
- [Guile-commits] 35/61: Add compute-cpl tests, Andy Wingo, 2015/01/22