3 |
#ifndef SCM_GOOPS_H |
#ifndef SCM_GOOPS_H |
4 |
#define SCM_GOOPS_H |
#define SCM_GOOPS_H |
5 |
|
|
6 |
/* Copyright (C) 1998,1999,2000,2001 Free Software Foundation, Inc. |
/* Copyright (C) 1998,1999,2000,2001, 2002 Free Software Foundation, Inc. |
7 |
* |
* |
8 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
128 |
|
|
129 |
#define SCM_CLASSP(x) \ |
#define SCM_CLASSP(x) \ |
130 |
(SCM_STRUCTP (x) && SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_METACLASS) |
(SCM_STRUCTP (x) && SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_METACLASS) |
131 |
#define SCM_VALIDATE_CLASS(pos, x) SCM_MAKE_VALIDATE (pos, x, CLASSP) |
#define SCM_VALIDATE_CLASS(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, CLASSP, "class") |
132 |
|
|
133 |
#define SCM_INSTANCEP(x) \ |
#define SCM_INSTANCEP(x) \ |
134 |
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_GOOPS)) |
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_GOOPS)) |
135 |
#define SCM_VALIDATE_INSTANCE(pos, x) SCM_MAKE_VALIDATE (pos, x, INSTANCEP) |
#define SCM_VALIDATE_INSTANCE(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, INSTANCEP, "instance") |
136 |
|
|
137 |
#define SCM_PUREGENERICP(x) \ |
#define SCM_PUREGENERICP(x) \ |
138 |
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_PURE_GENERIC)) |
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_PURE_GENERIC)) |
139 |
#define SCM_VALIDATE_PUREGENERIC(pos, x) SCM_MAKE_VALIDATE (pos, x, PUREGENERICP) |
#define SCM_VALIDATE_PUREGENERIC(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, PUREGENERICP, "pure generic function") |
140 |
|
|
141 |
#define SCM_ACCESSORP(x) \ |
#define SCM_ACCESSORP(x) \ |
142 |
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_ACCESSOR_METHOD)) |
(SCM_STRUCTP (x) && (SCM_STRUCT_VTABLE_FLAGS (x) & SCM_CLASSF_ACCESSOR_METHOD)) |
143 |
#define SCM_VALIDATE_ACCESSOR(pos, x) SCM_MAKE_VALIDATE (pos, x, ACCESSORP) |
#define SCM_VALIDATE_ACCESSOR(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, ACCESSORP, "accessor") |
144 |
|
|
145 |
#define SCM_SLOT(x, i) (SCM_PACK (SCM_INST (x) [i])) |
#define SCM_SLOT(x, i) (SCM_PACK (SCM_INST (x) [i])) |
146 |
#define SCM_SET_SLOT(x, i, v) (SCM_INST (x) [i] = SCM_UNPACK (v)) |
#define SCM_SET_SLOT(x, i, v) (SCM_INST (x) [i] = SCM_UNPACK (v)) |
153 |
|
|
154 |
#define SCM_GENERICP(x) \ |
#define SCM_GENERICP(x) \ |
155 |
(SCM_INSTANCEP (x) && SCM_SUBCLASSP (SCM_CLASS_OF (x), scm_class_generic)) |
(SCM_INSTANCEP (x) && SCM_SUBCLASSP (SCM_CLASS_OF (x), scm_class_generic)) |
156 |
#define SCM_VALIDATE_GENERIC(pos, x) SCM_MAKE_VALIDATE (pos, x, GENERICP) |
#define SCM_VALIDATE_GENERIC(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, GENERICP, "generic function") |
157 |
|
|
158 |
#define SCM_METHODP(x) \ |
#define SCM_METHODP(x) \ |
159 |
(SCM_INSTANCEP (x) && SCM_SUBCLASSP (SCM_CLASS_OF (x), scm_class_method)) |
(SCM_INSTANCEP (x) && SCM_SUBCLASSP (SCM_CLASS_OF (x), scm_class_method)) |
160 |
#define SCM_VALIDATE_METHOD(pos, x) SCM_MAKE_VALIDATE (pos, x, METHODP) |
#define SCM_VALIDATE_METHOD(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, METHODP, "method") |
161 |
|
|
162 |
#define SCM_MCACHE_N_SPECIALIZED(C) SCM_CADDR (C) |
#define SCM_MCACHE_N_SPECIALIZED(C) SCM_CADDR (C) |
163 |
#define SCM_SET_MCACHE_N_SPECIALIZED(C, X) SCM_SETCAR (SCM_CDDR (C), X) |
#define SCM_SET_MCACHE_N_SPECIALIZED(C, X) SCM_SETCAR (SCM_CDDR (C), X) |