* goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Wed, 8 Jan 2003 15:05:55 +0000 (15:05 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Wed, 8 Jan 2003 15:05:55 +0000 (15:05 +0000)
slots with instance allocation.

libguile/ChangeLog
libguile/goops.c

index 4282722..813349f 100644 (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.
index 1e5301b..2a644ac 100644 (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';