1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* Simplify the use of SCM_PUREGENERICP.

This commit is contained in:
Dirk Herrmann 2000-12-21 17:07:38 +00:00
parent 5bd44fc9ce
commit 25ba37dffa
3 changed files with 14 additions and 8 deletions

View 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

View 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

View 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)