Changeset 14473


Ignore:
Timestamp:
04/24/13 12:51:00 (10 years ago)
Author:
rschlatte
Message:

Unify slot names for metaobjects

  • move all slot names into SYS, define them in Symbol.java
Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

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

    r14470 r14473  
    3838public class StandardClass extends SlotClass
    3939{
    40 
    41   public static Symbol symName = PACKAGE_MOP.intern("NAME");
    42   public static Symbol symLayout = PACKAGE_MOP.intern("LAYOUT");
    43   public static Symbol symDirectSuperclasses
    44     = PACKAGE_MOP.intern("DIRECT-SUPERCLASSES");
    45   public static Symbol symDirectSubclasses
    46     = PACKAGE_MOP.intern("DIRECT-SUBCLASSES");
    47   public static Symbol symPrecedenceList
    48     = PACKAGE_MOP.intern("PRECEDENCE-LIST");
    49   public static Symbol symDirectMethods
    50     = PACKAGE_MOP.intern("DIRECT-METHODS");
    51   public static Symbol symDirectSlots
    52     = PACKAGE_MOP.intern("DIRECT-SLOTS");
    53   public static Symbol symSlots
    54     = PACKAGE_MOP.intern("SLOTS");
     40  // Slot names for standard-class.  Must agree with
     41  // redefine-class-forwarder calls in clos.lisp.
     42  public static Symbol symName = Symbol.NAME;
     43  public static Symbol symLayout = Symbol.LAYOUT;
     44  public static Symbol symDirectSuperclasses = Symbol.DIRECT_SUPERCLASSES;
     45  public static Symbol symDirectSubclasses = Symbol.DIRECT_SUBCLASSES;
     46  public static Symbol symPrecedenceList = Symbol.PRECEDENCE_LIST;
     47  public static Symbol symDirectMethods = Symbol.DIRECT_METHODS;
     48  public static Symbol symDirectSlots = Symbol.DIRECT_SLOTS;
     49  public static Symbol symSlots = Symbol.SLOTS;
    5550  public static Symbol symDirectDefaultInitargs
    56     = PACKAGE_MOP.intern("DIRECT-DEFAULT-INITARGS");
    57   public static Symbol symDefaultInitargs
    58     = PACKAGE_MOP.intern("DEFAULT-INITARGS");
    59   public static Symbol symFinalizedP
    60     = PACKAGE_MOP.intern("FINALIZED-P");
     51    = Symbol.DIRECT_DEFAULT_INITARGS;
     52  public static Symbol symDefaultInitargs = Symbol.DEFAULT_INITARGS;
     53  public static Symbol symFinalizedP = Symbol.FINALIZED_P;
    6154
    6255  // used as init-function for slots in this file.
     
    390383  {
    391384    return
    392         list(helperMakeSlotDefinition("NAME", constantlyNil),
    393              helperMakeSlotDefinition("LAYOUT", constantlyNil),
    394              helperMakeSlotDefinition("DIRECT-SUPERCLASSES", constantlyNil),
    395              helperMakeSlotDefinition("DIRECT-SUBCLASSES", constantlyNil),
    396              helperMakeSlotDefinition("PRECEDENCE-LIST", constantlyNil),
    397              helperMakeSlotDefinition("DIRECT-METHODS", constantlyNil),
    398              helperMakeSlotDefinition("DIRECT-SLOTS", constantlyNil),
    399              helperMakeSlotDefinition("SLOTS", constantlyNil),
    400              helperMakeSlotDefinition("DIRECT-DEFAULT-INITARGS", constantlyNil),
    401              helperMakeSlotDefinition("DEFAULT-INITARGS", constantlyNil),
    402              helperMakeSlotDefinition("FINALIZED-P", constantlyNil),
    403              new SlotDefinition(Symbol._DOCUMENTATION,
    404                                 list(PACKAGE_MOP.intern("CLASS-DOCUMENTATION")),
    405                                 constantlyNil, list(internKeyword("DOCUMENTATION"))));
    406   }
    407 
    408 
    409 
    410   private static final SlotDefinition helperMakeSlotDefinition(String name,
    411                                                                Function init)
    412   {
    413     return
    414         new SlotDefinition(PACKAGE_MOP.intern(name),   // name
    415              list(PACKAGE_MOP.intern("CLASS-" + name)), // readers
    416              init);
     385      list(new SlotDefinition(symName, list(Symbol.CLASS_NAME), constantlyNil),
     386           new SlotDefinition(symLayout, list(Symbol.CLASS_LAYOUT), constantlyNil),
     387           new SlotDefinition(symDirectSuperclasses, list(Symbol.CLASS_DIRECT_SUPERCLASSES), constantlyNil),
     388           new SlotDefinition(symDirectSubclasses, list(Symbol.CLASS_DIRECT_SUBCLASSES), constantlyNil),
     389           new SlotDefinition(symPrecedenceList, list(Symbol.CLASS_PRECEDENCE_LIST), constantlyNil),
     390           new SlotDefinition(symDirectMethods, list(Symbol.CLASS_DIRECT_METHODS), constantlyNil),
     391           new SlotDefinition(symDirectSlots, list(Symbol.CLASS_DIRECT_SLOTS), constantlyNil),
     392           new SlotDefinition(symSlots, list(Symbol.CLASS_SLOTS), constantlyNil),
     393           new SlotDefinition(symDirectDefaultInitargs, list(Symbol.CLASS_DIRECT_DEFAULT_INITARGS), constantlyNil),
     394           new SlotDefinition(symDefaultInitargs, list(Symbol.CLASS_DEFAULT_INITARGS), constantlyNil),
     395           new SlotDefinition(symFinalizedP, list(Symbol.CLASS_FINALIZED_P), constantlyNil),
     396           new SlotDefinition(Symbol._DOCUMENTATION,
     397                              list(PACKAGE_MOP.intern("CLASS-DOCUMENTATION")),
     398                              constantlyNil, list(internKeyword("DOCUMENTATION"))));
    417399  }
    418400
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r14472 r14473  
    29762976  public static final Symbol CLASS_LAYOUT =
    29772977    PACKAGE_MOP.addInternalSymbol("CLASS-LAYOUT");
     2978  public static final Symbol CLASS_DEFAULT_INITARGS =
     2979    PACKAGE_MOP.addExternalSymbol("CLASS-DEFAULT_INITARGS");
     2980  public static final Symbol CLASS_DIRECT_METHODS =
     2981    PACKAGE_MOP.addExternalSymbol("CLASS-DIRECT-METHODS");
     2982  public static final Symbol CLASS_DIRECT_DEFAULT_INITARGS =
     2983    PACKAGE_MOP.addExternalSymbol("CLASS-DIRECT-DEFAULT_INITARGS");
     2984  public static final Symbol CLASS_DIRECT_SLOTS =
     2985    PACKAGE_MOP.addExternalSymbol("CLASS-DIRECT-SLOTS");
     2986  public static final Symbol CLASS_DIRECT_SUBCLASSES =
     2987    PACKAGE_MOP.addExternalSymbol("CLASS-DIRECT-SUBCLASSES");
     2988  public static final Symbol CLASS_DIRECT_SUPERCLASSES =
     2989    PACKAGE_MOP.addExternalSymbol("CLASS-DIRECT-SUPERCLASSES");
     2990  public static final Symbol CLASS_FINALIZED_P =
     2991    PACKAGE_MOP.addExternalSymbol("CLASS-FINALIZED-P");
    29782992  public static final Symbol CLASS_PRECEDENCE_LIST =
    2979     PACKAGE_MOP.addInternalSymbol("CLASS-PRECEDENCE-LIST");
     2993    PACKAGE_MOP.addExternalSymbol("CLASS-PRECEDENCE-LIST");
     2994  public static final Symbol CLASS_SLOTS =
     2995    PACKAGE_MOP.addExternalSymbol("CLASS-SLOTS");
    29802996  public static final Symbol EQL_SPECIALIZER =
    29812997    PACKAGE_MOP.addExternalSymbol("EQL-SPECIALIZER");
     
    30533069  public static final Symbol COMPILED_LISP_FUNCTION_P =
    30543070    PACKAGE_SYS.addExternalSymbol("COMPILED-LISP-FUNCTION-P");
     3071  public static final Symbol DEFAULT_INITARGS =
     3072    PACKAGE_SYS.addExternalSymbol("DEFAULT-INITARGS");
     3073  public static final Symbol DIRECT_METHODS =
     3074    PACKAGE_SYS.addExternalSymbol("DIRECT-METHODS");
     3075  public static final Symbol DIRECT_SLOTS =
     3076    PACKAGE_SYS.addExternalSymbol("DIRECT-SLOTS");
     3077  public static final Symbol DIRECT_SUBCLASSES =
     3078    PACKAGE_SYS.addExternalSymbol("DIRECT-SUBCLASSES");
     3079  public static final Symbol DIRECT_DEFAULT_INITARGS =
     3080    PACKAGE_SYS.addExternalSymbol("DIRECT-DEFAULT-INITARGS");
     3081  public static final Symbol DIRECT_SUPERCLASSES =
     3082    PACKAGE_SYS.addExternalSymbol("DIRECT-SUPERCLASSES");
    30553083  public static final Symbol _DOCUMENTATION =
    30563084    PACKAGE_SYS.addExternalSymbol("%DOCUMENTATION");
     
    30613089  public static final Symbol ENVIRONMENT =
    30623090    PACKAGE_SYS.addExternalSymbol("ENVIRONMENT");
     3091  public static final Symbol FINALIZED_P =
     3092    PACKAGE_SYS.addExternalSymbol("FINALIZED-P");
    30633093  public static final Symbol FLOAT_UNDERFLOW_MODE =
    30643094    PACKAGE_SYS.addExternalSymbol("FLOAT-UNDERFLOW-MODE");
     
    30753105  public static final Symbol LAYOUT =
    30763106    PACKAGE_SYS.addExternalSymbol("LAYOUT");
     3107  public static final Symbol NAME =
     3108    PACKAGE_SYS.addExternalSymbol("NAME");
    30773109  public static final Symbol NAMED_LAMBDA =
    30783110    PACKAGE_SYS.addExternalSymbol("NAMED-LAMBDA");
    30793111  public static final Symbol OUTPUT_OBJECT =
    30803112    PACKAGE_SYS.addExternalSymbol("OUTPUT-OBJECT");
     3113  public static final Symbol PRECEDENCE_LIST =
     3114    PACKAGE_SYS.addExternalSymbol("PRECEDENCE-LIST");
    30813115  public static final Symbol PUTHASH =
    30823116    PACKAGE_SYS.addExternalSymbol("PUTHASH");
     
    30933127  public static final Symbol SETF_INVERSE =
    30943128    PACKAGE_SYS.addExternalSymbol("SETF-INVERSE");
     3129  public static final Symbol SLOTS = PACKAGE_SYS.addExternalSymbol("SLOTS");
    30953130  public static final Symbol SLOT_DEFINITION =
    30963131    PACKAGE_SYS.addExternalSymbol("SLOT-DEFINITION");
     
    31823217    PACKAGE_SYS.addInternalSymbol("%METHOD-COMBINATION");
    31833218  public static final Symbol METHODS = PACKAGE_SYS.addInternalSymbol("METHODS");
    3184   public static final Symbol NAME = PACKAGE_SYS.addInternalSymbol("NAME");
    31853219  public static final Symbol OBJECT = PACKAGE_SYS.addInternalSymbol("OBJECT");
    31863220  public static final Symbol OPERANDS =
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r14463 r14473  
    30543054                    standard-class funcallable-standard-class)))))
    30553055
    3056 
    3057 (redefine-class-forwarder class-name name)
     3056;;; The slot names here must agree with the ones defined in
     3057;;; StandardClass.java:layoutStandardClass.
     3058(redefine-class-forwarder class-name sys:name)
    30583059;;; AMOP pg. 230
    3059 (redefine-class-forwarder (setf class-name) name
     3060(redefine-class-forwarder (setf class-name) sys:name
    30603061   ((standard-class . (progn (reinitialize-instance class :name new-value) new-value))
    30613062    (funcallable-standard-class . (progn (reinitialize-instance class :name new-value) new-value))))
    3062 (redefine-class-forwarder class-slots slots)
    3063 (redefine-class-forwarder (setf class-slots) slots)
    3064 (redefine-class-forwarder class-direct-slots direct-slots)
    3065 (redefine-class-forwarder (setf class-direct-slots) direct-slots)
    3066 (redefine-class-forwarder class-layout layout)
    3067 (redefine-class-forwarder (setf class-layout) layout)
    3068 (redefine-class-forwarder class-direct-superclasses direct-superclasses)
    3069 (redefine-class-forwarder (setf class-direct-superclasses) direct-superclasses)
    3070 (redefine-class-forwarder class-direct-subclasses direct-subclasses)
    3071 (redefine-class-forwarder (setf class-direct-subclasses) direct-subclasses)
    3072 (redefine-class-forwarder class-direct-methods direct-methods)
    3073 (redefine-class-forwarder (setf class-direct-methods) direct-methods)
    3074 (redefine-class-forwarder class-precedence-list precedence-list)
    3075 (redefine-class-forwarder (setf class-precedence-list) precedence-list)
    3076 (redefine-class-forwarder class-finalized-p finalized-p)
    3077 (redefine-class-forwarder (setf class-finalized-p) finalized-p)
    3078 (redefine-class-forwarder class-default-initargs default-initargs)
    3079 (redefine-class-forwarder (setf class-default-initargs) default-initargs)
    3080 (redefine-class-forwarder class-direct-default-initargs direct-default-initargs)
    3081 (redefine-class-forwarder (setf class-direct-default-initargs) direct-default-initargs)
     3063(redefine-class-forwarder class-slots sys:slots)
     3064(redefine-class-forwarder (setf class-slots) sys:slots)
     3065(redefine-class-forwarder class-direct-slots sys:direct-slots)
     3066(redefine-class-forwarder (setf class-direct-slots) sys:direct-slots)
     3067(redefine-class-forwarder class-layout sys:layout)
     3068(redefine-class-forwarder (setf class-layout) sys:layout)
     3069(redefine-class-forwarder class-direct-superclasses sys:direct-superclasses)
     3070(redefine-class-forwarder (setf class-direct-superclasses) sys:direct-superclasses)
     3071(redefine-class-forwarder class-direct-subclasses sys:direct-subclasses)
     3072(redefine-class-forwarder (setf class-direct-subclasses) sys:direct-subclasses)
     3073(redefine-class-forwarder class-direct-methods sys:direct-methods)
     3074(redefine-class-forwarder (setf class-direct-methods) sys:direct-methods)
     3075(redefine-class-forwarder class-precedence-list sys:precedence-list)
     3076(redefine-class-forwarder (setf class-precedence-list) sys:precedence-list)
     3077(redefine-class-forwarder class-finalized-p sys:finalized-p)
     3078(redefine-class-forwarder (setf class-finalized-p) sys:finalized-p)
     3079(redefine-class-forwarder class-default-initargs sys:default-initargs)
     3080(redefine-class-forwarder (setf class-default-initargs) sys:default-initargs)
     3081(redefine-class-forwarder class-direct-default-initargs sys:direct-default-initargs)
     3082(redefine-class-forwarder (setf class-direct-default-initargs) sys:direct-default-initargs)
    30823083
    30833084;;; Class definition
Note: See TracChangeset for help on using the changeset viewer.