Changeset 13713


Ignore:
Timestamp:
01/04/12 13:44:27 (10 years ago)
Author:
Mark Evenson
Message:

[PATCH 1/2] add class METAOBJECT, splice it into mop class

From 0d36155221ec6ac028cde6ba3741253e618773e9 Mon Sep 17 00:00:00 2001

hierarchy.

... see AMOP table 5.1
---

src/org/armedbear/lisp/GenericFunction.java | 2 +-
src/org/armedbear/lisp/Metaobject.java | 52 +++++++++++++++++++++++++++
src/org/armedbear/lisp/StandardClass.java | 40 ++++++++++++---------
src/org/armedbear/lisp/Symbol.java | 2 +
4 files changed, 78 insertions(+), 18 deletions(-)
create mode 100644 src/org/armedbear/lisp/Metaobject.java

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
1 added
3 edited

Legend:

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

    r12288 r13713  
    3636import static org.armedbear.lisp.Lisp.*;
    3737
    38 public abstract class GenericFunction extends StandardObject
     38public abstract class GenericFunction extends Metaobject
    3939{
    4040    protected GenericFunction(LispClass cls, int length)
  • trunk/abcl/src/org/armedbear/lisp/StandardClass.java

    r13440 r13713  
    386386  public static final StandardClass STANDARD_OBJECT =
    387387    addStandardClass(Symbol.STANDARD_OBJECT, list(BuiltInClass.CLASS_T));
     388  public static final StandardClass METAOBJECT =
     389    addStandardClass(Symbol.METAOBJECT, list(STANDARD_OBJECT));
    388390
    389391    public static final StandardClass SLOT_DEFINITION =
    390         addStandardClass(Symbol.SLOT_DEFINITION, list(STANDARD_OBJECT));
     392        addStandardClass(Symbol.SLOT_DEFINITION, list(METAOBJECT));
    391393    public static final StandardClass STANDARD_SLOT_DEFINITION =
    392394        addClass(Symbol.STANDARD_SLOT_DEFINITION, new SlotDefinitionClass(Symbol.STANDARD_SLOT_DEFINITION, list(SLOT_DEFINITION)));
     
    417419  // BuiltInClass.FUNCTION is also null here (see previous comment).
    418420  public static final StandardClass GENERIC_FUNCTION =
    419     addStandardClass(Symbol.GENERIC_FUNCTION, list(BuiltInClass.FUNCTION,
    420                                                     STANDARD_OBJECT));
     421    addStandardClass(Symbol.GENERIC_FUNCTION, list(METAOBJECT,
     422                                                   BuiltInClass.FUNCTION));
    421423
    422424  public static final StandardClass CLASS =
     
    537539
    538540  public static final StandardClass METHOD =
    539     addStandardClass(Symbol.METHOD, list(STANDARD_OBJECT));
     541    addStandardClass(Symbol.METHOD, list(METAOBJECT));
    540542
    541543  public static final StandardClass STANDARD_METHOD =
     
    567569    STANDARD_CLASS.setDirectSuperclass(CLASS);
    568570    STANDARD_OBJECT.setDirectSuperclass(BuiltInClass.CLASS_T);
    569     GENERIC_FUNCTION.setDirectSuperclasses(list(BuiltInClass.FUNCTION,
    570                                                  STANDARD_OBJECT));
     571    GENERIC_FUNCTION.setDirectSuperclasses(list(METAOBJECT,
     572                                                BuiltInClass.FUNCTION));
    571573
    572574    ARITHMETIC_ERROR.setCPL(ARITHMETIC_ERROR, ERROR, SERIOUS_CONDITION,
     
    632634    FORWARD_REFERENCED_CLASS.setCPL(FORWARD_REFERENCED_CLASS, CLASS,
    633635                                    BuiltInClass.CLASS_T);
    634     GENERIC_FUNCTION.setCPL(GENERIC_FUNCTION, STANDARD_OBJECT,
     636    GENERIC_FUNCTION.setCPL(GENERIC_FUNCTION, METAOBJECT, STANDARD_OBJECT,
    635637                            BuiltInClass.FUNCTION,
    636638                            BuiltInClass.CLASS_T);
     
    639641    JAVA_EXCEPTION.setDirectSlotDefinitions(
    640642      list(new SlotDefinition(Symbol.CAUSE, list(Symbol.JAVA_EXCEPTION_CAUSE))));
    641     METHOD.setCPL(METHOD, STANDARD_OBJECT, BuiltInClass.CLASS_T);
     643    METAOBJECT.setCPL(METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T);
     644    METHOD.setCPL(METHOD, METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T);
    642645    PACKAGE_ERROR.setCPL(PACKAGE_ERROR, ERROR, SERIOUS_CONDITION, CONDITION,
    643646                         STANDARD_OBJECT, BuiltInClass.CLASS_T);
     
    726729    FLOATING_POINT_UNDERFLOW.finalizeClass();
    727730    JAVA_EXCEPTION.finalizeClass();
     731    METAOBJECT.finalizeClass();
    728732    PACKAGE_ERROR.finalizeClass();
    729733    PARSE_ERROR.finalizeClass();
     
    748752    // SlotDefinitionClass.java, but we need to fill in a few things here.
    749753    Debug.assertTrue(SLOT_DEFINITION.isFinalized());
    750     SLOT_DEFINITION.setCPL(SLOT_DEFINITION, STANDARD_OBJECT,
     754    SLOT_DEFINITION.setCPL(SLOT_DEFINITION, METAOBJECT, STANDARD_OBJECT,
    751755                           BuiltInClass.CLASS_T);
    752756    SLOT_DEFINITION.setDirectSlotDefinitions(SLOT_DEFINITION.getClassLayout().generateSlotDefinitions());
     
    755759
    756760    DIRECT_SLOT_DEFINITION.setCPL(DIRECT_SLOT_DEFINITION, SLOT_DEFINITION,
    757                                   STANDARD_OBJECT, BuiltInClass.CLASS_T);
     761                                  METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T);
    758762    DIRECT_SLOT_DEFINITION.finalizeClass();
    759763    EFFECTIVE_SLOT_DEFINITION.setCPL(EFFECTIVE_SLOT_DEFINITION, SLOT_DEFINITION,
    760                                      STANDARD_OBJECT, BuiltInClass.CLASS_T);
     764                                     METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T);
    761765    EFFECTIVE_SLOT_DEFINITION.finalizeClass();
    762766    STANDARD_SLOT_DEFINITION.setCPL(STANDARD_SLOT_DEFINITION, SLOT_DEFINITION,
    763                                     STANDARD_OBJECT, BuiltInClass.CLASS_T);
     767                                    METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T);
    764768    STANDARD_SLOT_DEFINITION.finalizeClass();
    765769    STANDARD_DIRECT_SLOT_DEFINITION.setCPL(STANDARD_DIRECT_SLOT_DEFINITION, STANDARD_SLOT_DEFINITION,
    766                                            DIRECT_SLOT_DEFINITION, SLOT_DEFINITION, STANDARD_OBJECT,
     770                                           DIRECT_SLOT_DEFINITION, SLOT_DEFINITION, METAOBJECT, STANDARD_OBJECT,
    767771                                           BuiltInClass.CLASS_T);
    768772    STANDARD_DIRECT_SLOT_DEFINITION.finalizeClass();
    769773    STANDARD_EFFECTIVE_SLOT_DEFINITION.setCPL(STANDARD_EFFECTIVE_SLOT_DEFINITION, STANDARD_SLOT_DEFINITION,
    770                                               EFFECTIVE_SLOT_DEFINITION, SLOT_DEFINITION, STANDARD_OBJECT,
     774                                              EFFECTIVE_SLOT_DEFINITION, SLOT_DEFINITION, METAOBJECT, STANDARD_OBJECT,
    771775                                              BuiltInClass.CLASS_T);
    772776    STANDARD_EFFECTIVE_SLOT_DEFINITION.finalizeClass();
     
    774778    // STANDARD-METHOD
    775779    Debug.assertTrue(STANDARD_METHOD.isFinalized());
    776     STANDARD_METHOD.setCPL(STANDARD_METHOD, METHOD, STANDARD_OBJECT,
     780    STANDARD_METHOD.setCPL(STANDARD_METHOD, METHOD, METAOBJECT, STANDARD_OBJECT,
    777781                           BuiltInClass.CLASS_T);
    778782    STANDARD_METHOD.setDirectSlotDefinitions(STANDARD_METHOD.getClassLayout().generateSlotDefinitions());
     
    783787    Debug.assertTrue(STANDARD_READER_METHOD.isFinalized());
    784788    STANDARD_READER_METHOD.setCPL(STANDARD_READER_METHOD, STANDARD_METHOD,
    785                                   METHOD, STANDARD_OBJECT, BuiltInClass.CLASS_T);
     789                                  METHOD, METAOBJECT, STANDARD_OBJECT,
     790                                  BuiltInClass.CLASS_T);
    786791    STANDARD_READER_METHOD.setSlotDefinitions(STANDARD_READER_METHOD.getClassLayout().generateSlotDefinitions());
    787792    // All but the last slot are inherited.
     
    791796    Debug.assertTrue(STANDARD_GENERIC_FUNCTION.isFinalized());
    792797    STANDARD_GENERIC_FUNCTION.setCPL(STANDARD_GENERIC_FUNCTION,
    793                                      GENERIC_FUNCTION, STANDARD_OBJECT,
     798                                     GENERIC_FUNCTION, METAOBJECT,
     799                                     STANDARD_OBJECT,
    794800                                     BuiltInClass.FUNCTION,
    795801                                     BuiltInClass.CLASS_T);
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r13695 r13713  
    29682968  public static final Symbol CLASS_PRECEDENCE_LIST =
    29692969    PACKAGE_MOP.addInternalSymbol("CLASS-PRECEDENCE-LIST");
     2970  public static final Symbol METAOBJECT =
     2971    PACKAGE_MOP.addExternalSymbol("METAOBJECT");
    29702972  public static final Symbol STANDARD_READER_METHOD =
    29712973    PACKAGE_MOP.addExternalSymbol("STANDARD-READER-METHOD");
Note: See TracChangeset for help on using the changeset viewer.