summaryrefslogtreecommitdiff
path: root/libguile/goops.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-11-08 11:49:06 +0100
committerAndy Wingo <wingo@pobox.com>2009-11-26 00:25:07 +0100
commit9f63ce021c567056c02b81d96742ff91416b886f (patch)
treecf209c811574b7a77b937af9d975b7f2c459ba41 /libguile/goops.c
parent72d2e7e65f1895df9c527e792a05674d02dcac9a (diff)
downloadguile-9f63ce021c567056c02b81d96742ff91416b886f.tar.gz
make sure that when equal? is extended, that the generic has a method
* libguile/goops.h: * libguile/goops.c (scm_set_primitive_generic_x): New function, for now local to the goops module. * module/oop/goops.scm (equal?): Make sure that when equal? is extended, that the generic already has a default method.
Diffstat (limited to 'libguile/goops.c')
-rw-r--r--libguile/goops.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index c2705f554..88408f686 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -1915,6 +1915,19 @@ SCM_DEFINE (scm_enable_primitive_generic_x, "enable-primitive-generic!", 0, 0, 1
}
#undef FUNC_NAME
+SCM_DEFINE (scm_set_primitive_generic_x, "set-primitive-generic!", 2, 0, 0,
+ (SCM subr, SCM generic),
+ "")
+#define FUNC_NAME s_scm_set_primitive_generic_x
+{
+ SCM_ASSERT (scm_subr_p (subr) && SCM_SUBR_GENERIC (subr),
+ subr, SCM_ARG1, FUNC_NAME);
+ SCM_ASSERT (SCM_PUREGENERICP (generic), generic, SCM_ARG2, FUNC_NAME);
+ *SCM_SUBR_GENERIC (subr) = generic;
+ return SCM_UNSPECIFIED;
+}
+#undef FUNC_NAME
+
SCM_DEFINE (scm_primitive_generic_generic, "primitive-generic-generic", 1, 0, 0,
(SCM subr),
"")