diff options
Diffstat (limited to 'libguile/goops.h')
-rw-r--r-- | libguile/goops.h | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/libguile/goops.h b/libguile/goops.h index 790c0b448..9d44d26c5 100644 --- a/libguile/goops.h +++ b/libguile/goops.h @@ -1,25 +1,24 @@ -/* classes: h_files */ - #ifndef SCM_GOOPS_H #define SCM_GOOPS_H -/* Copyright (C) 1998,1999,2000,2001,2002,2003, 2006, 2008, 2009, 2011, 2015 Free Software Foundation, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ +/* Copyright 1998-2003,2006,2008-2009,2011,2015,2017-2018 + Free Software Foundation, Inc. + + This file is part of Guile. + + Guile is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Guile is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Guile. If not, see + <https://www.gnu.org/licenses/>. */ @@ -30,9 +29,10 @@ * Erick Gallesio <eg@unice.fr>. */ -#include "libguile/__scm.h" +#include "libguile/boolean.h" +#include "libguile/list.h" +#include "libguile/ports.h" -#include "libguile/validate.h" /* {Class flags} * @@ -40,10 +40,22 @@ * certain class or its subclasses when traversal of the inheritance * graph would be too costly. */ +/* Set for all GOOPS classes. */ #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_SLOT SCM_VTABLE_FLAG_GOOPS_2 -#define SCM_VTABLE_FLAG_GOOPS_STATIC SCM_VTABLE_FLAG_GOOPS_3 +/* Set for GOOPS classes whose instances are <slot> objects. */ +#define SCM_VTABLE_FLAG_GOOPS_SLOT SCM_VTABLE_FLAG_GOOPS_1 +/* Set for GOOPS classes whose instance's slots must always be allocated + to the same indices, for all concrete subclasses. */ +#define SCM_VTABLE_FLAG_GOOPS_STATIC_SLOT_ALLOCATION SCM_VTABLE_FLAG_GOOPS_2 +/* Set for GOOPS classes whose instances are "indirect", meaning they + just have one slot that indirects to a direct instance with the + slots. For non-class instances, this is at struct slot 0. For class + instances, it's the first slot after the <class> fixed slots. */ +#define SCM_VTABLE_FLAG_GOOPS_INDIRECT SCM_VTABLE_FLAG_GOOPS_3 +/* For indirect classes, the slots object itself has a direct vtable. + This flag will be set on that vtable if the instance needs to migrate + to a new class. */ +#define SCM_VTABLE_FLAG_GOOPS_NEEDS_MIGRATION SCM_VTABLE_FLAG_GOOPS_4 #define SCM_CLASS_OF(x) SCM_STRUCT_VTABLE (x) #define SCM_CLASS_FLAGS(class) (SCM_VTABLE_FLAGS (class)) @@ -52,9 +64,7 @@ #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_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) #define SCM_CLASS_OF(x) SCM_STRUCT_VTABLE (x) @@ -72,7 +82,7 @@ #define SCM_SUBCLASSP(c1, c2) \ (scm_is_true (scm_c_memq (c2, scm_class_precedence_list (c1)))) #define SCM_IS_A_P(x, c) \ - (SCM_INSTANCEP (x) && SCM_SUBCLASSP (SCM_CLASS_OF (x), c)) + (SCM_INSTANCEP (x) && SCM_SUBCLASSP (scm_class_of (x), c)) #define SCM_GENERICP(x) (scm_is_generic (x)) #define SCM_VALIDATE_GENERIC(pos, x) SCM_MAKE_VALIDATE_MSG (pos, x, GENERICP, "generic function") @@ -120,13 +130,11 @@ SCM_API SCM scm_method_procedure (SCM obj); SCM_API SCM scm_slot_bound_p (SCM obj, SCM slot_name); SCM_API SCM scm_slot_exists_p (SCM obj, SCM slot_name); SCM_API SCM scm_sys_modify_instance (SCM old, SCM newinst); -SCM_API SCM scm_sys_modify_class (SCM old, SCM newcls); SCM_API SCM scm_generic_capability_p (SCM proc); SCM_API SCM scm_enable_primitive_generic_x (SCM subrs); SCM_INTERNAL SCM scm_set_primitive_generic_x (SCM subr, SCM generic); SCM_API SCM scm_primitive_generic_generic (SCM subr); SCM_API SCM scm_make (SCM args); -SCM_API void scm_change_object_class (SCM, SCM, SCM); /* These procedures are for dispatching to a generic when a primitive fails to apply. They raise a wrong-type-arg error if the primitive's @@ -142,9 +150,3 @@ SCM_INTERNAL SCM scm_i_define_class_for_vtable (SCM vtable); SCM_INTERNAL void scm_init_goops (void); #endif /* SCM_GOOPS_H */ - -/* - Local Variables: - c-file-style: "gnu" - End: -*/ |