Changeset 12122


Ignore:
Timestamp:
08/28/09 07:52:48 (12 years ago)
Author:
ehuelsmann
Message:

Allow file-compilation of already-defined structure classes
in order to support the bootstrapping process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/StructureClass.java

    r11488 r12122  
    9696            LispObject slots = checkList(third);
    9797            Symbol include = checkSymbol(fourth);
    98             StructureClass c = new StructureClass(symbol);
     98            LispClass existingClass = LispClass.findClass(symbol);
     99            StructureClass c;
     100
     101            if (existingClass instanceof StructureClass)
     102                // Change the existing class definition if there is one.
     103                // The compiler has this scenario, where it is first loaded
     104                // and subsequently run through the file compiler - which
     105                // re-creates the same structure and breaks the inheritance
     106                // if we don't re-use the existing class. Reusing the
     107                // existing class is alright in this case, since we're
     108                // recreating the same class.
     109                // Redefinition of structures is undefined in the CLHS.
     110                // As per the DEFSTRUCT-REDEFINITION it is allowed, but
     111                // consequences are undefined.
     112                c = (StructureClass)existingClass;
     113            else
     114                c = new StructureClass(symbol);
    99115            if (include != NIL) {
    100116                LispClass includedClass = LispClass.findClass(include);
Note: See TracChangeset for help on using the changeset viewer.