* Simplify the use of SCM_PUREGENERICP.
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Thu, 21 Dec 2000 17:07:38 +0000 (17:07 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Thu, 21 Dec 2000 17:07:38 +0000 (17:07 +0000)
libguile/ChangeLog
libguile/goops.c
libguile/goops.h

index 88fb734..489313d 100644 (file)
@@ -1,3 +1,10 @@
+2000-12-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * goops.h (SCM_PUREGENERICP):  Include the SCM_STRUCTP test.
+
+       * goops.c (scm_sys_invalidate_method_cache_x, scm_m_atdispatch,
+       scm_pure_generic_p):  The SCM_STRUCTP test is implied.
+
 2000-12-20  Gary Houston  <ghouston@arglist.com>
 
        * continuations.c (continuation_apply): subtract the length of
index 2ddd89f..0c4ffa6 100644 (file)
@@ -1555,8 +1555,7 @@ SCM_DEFINE (scm_sys_invalidate_method_cache_x, "%invalidate-method-cache!", 1, 0
 #define FUNC_NAME s_scm_sys_invalidate_method_cache_x
 {
   SCM used_by;
-  SCM_ASSERT (SCM_STRUCTP (gf) && SCM_PUREGENERICP (gf),
-             gf, SCM_ARG1, FUNC_NAME);
+  SCM_ASSERT (SCM_PUREGENERICP (gf), gf, SCM_ARG1, FUNC_NAME);
   used_by = SCM_SLOT (gf, scm_si_used_by);
   if (SCM_NFALSEP (used_by))
     {
@@ -1891,8 +1890,7 @@ scm_m_atdispatch (SCM xorig, SCM env)
   SCM_ASSYNT (SCM_VECTORP (v), v, SCM_ARG3, s_atdispatch);
   x = SCM_CDR (x);
   gf = SCM_XEVALCAR (x, env);
-  SCM_ASSYNT (SCM_STRUCTP (gf) && SCM_PUREGENERICP (gf),
-             gf, SCM_ARG4, s_atdispatch);
+  SCM_ASSYNT (SCM_PUREGENERICP (gf), gf, SCM_ARG4, s_atdispatch);
   return SCM_LIST5 (SCM_IM_DISPATCH, args, n, v, gf);
 }
 #undef FUNC_NAME
@@ -2601,7 +2599,7 @@ SCM_DEFINE (scm_pure_generic_p, "pure-generic?", 1, 0, 0,
            "")
 #define FUNC_NAME s_scm_pure_generic_p
 {
-  return SCM_BOOL (SCM_STRUCTP (obj) && SCM_PUREGENERICP (obj));
+  return SCM_BOOL (SCM_PUREGENERICP (obj));
 }
 #undef FUNC_NAME
 
index d9f792e..3c123c8 100644 (file)
@@ -125,11 +125,12 @@ typedef struct scm_method_t {
  (SCM_UNPACK (SCM_STRUCT_DATA (x)[scm_struct_i_n_words]) \
   - scm_struct_n_extra_words) \
 
-#define SCM_INSTANCEP(x)       (SCM_STRUCTP (x) \
-                              && (SCM_INST_TYPE (x) & SCM_CLASSF_GOOPS))
+#define SCM_INSTANCEP(x) \
+  (SCM_STRUCTP (x) && (SCM_INST_TYPE (x) & SCM_CLASSF_GOOPS))
 #define SCM_VALIDATE_INSTANCE(pos, x) SCM_MAKE_VALIDATE (pos, x, INSTANCEP)
 
-#define SCM_PUREGENERICP(x)    (SCM_INST_TYPE(x) & SCM_CLASSF_PURE_GENERIC)
+#define SCM_PUREGENERICP(x) \
+  (SCM_STRUCTP (x) && (SCM_INST_TYPE(x) & SCM_CLASSF_PURE_GENERIC))
 #define SCM_SIMPLEMETHODP(x)   (SCM_INST_TYPE(x) & SCM_CLASSF_SIMPLE_METHOD)
 #define SCM_ACCESSORP(x)       (SCM_INST_TYPE(x) & SCM_CLASSF_ACCESSOR_METHOD)
 #define SCM_VALIDATE_ACCESSOR(pos, x) SCM_MAKE_VALIDATE (pos, x, ACCESSORP)