1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

* goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for

slots with instance allocation.
This commit is contained in:
Mikael Djurfeldt 2003-01-08 15:05:55 +00:00
parent bbf8d52350
commit b46fae006d
2 changed files with 17 additions and 3 deletions

View file

@ -1,5 +1,8 @@
2003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
slots with instance allocation.
* goops.c, goops.h (scm_class_extended_generic_with_setter): New
class.
(scm_compute_applicable_methods): Use scm_generic_function_methods.

View file

@ -466,6 +466,8 @@ SCM_DEFINE (scm_sys_initialize_object, "%initialize-object", 2, 0, 0,
SCM_KEYWORD (k_class, "class");
SCM_KEYWORD (k_allocation, "allocation");
SCM_KEYWORD (k_instance, "instance");
SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0,
(SCM class),
@ -492,14 +494,23 @@ SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0,
for (i = 0; i < n; i += 2)
{
long len;
SCM type;
SCM type, allocation;
char p, a;
if (!SCM_CONSP (slots))
SCM_MISC_ERROR ("too few slot definitions", SCM_EOL);
len = scm_ilength (SCM_CDAR (slots));
type = scm_i_get_keyword (k_class, SCM_CDAR (slots), len, SCM_BOOL_F,
FUNC_NAME);
allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots),
len, k_instance, FUNC_NAME);
while (!SCM_EQ_P (allocation, k_instance))
{
slots = SCM_CDR (slots);
len = scm_ilength (SCM_CDAR (slots));
allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots),
len, k_instance, FUNC_NAME);
}
type = scm_i_get_keyword (k_class, SCM_CDAR (slots),
len, SCM_BOOL_F, FUNC_NAME);
if (SCM_FALSEP (type))
{
p = 'p';