Changeset 14474


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

Eliminate slot positions fron StandardGenericFunctionClass?

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r14468 r14474  
    5353  {
    5454    super(layout);
    55     slots[StandardGenericFunctionClass.SLOT_INDEX_NAME] = NIL;
    56     slots[StandardGenericFunctionClass.SLOT_INDEX_LAMBDA_LIST] = NIL;
    57     slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS] = NIL;
    58     slots[StandardGenericFunctionClass.SLOT_INDEX_OPTIONAL_ARGS] = NIL;
    59     slots[StandardGenericFunctionClass.SLOT_INDEX_INITIAL_METHODS] = NIL;
    60     slots[StandardGenericFunctionClass.SLOT_INDEX_METHODS] = NIL;
    61     slots[StandardGenericFunctionClass.SLOT_INDEX_METHOD_CLASS] =
    62       StandardClass.STANDARD_METHOD;
    63     slots[StandardGenericFunctionClass.SLOT_INDEX_METHOD_COMBINATION] =
    64       list(Symbol.STANDARD); // fixed up by clos.lisp:shared-initialize :after
    65     slots[StandardGenericFunctionClass.SLOT_INDEX_ARGUMENT_PRECEDENCE_ORDER] =
    66       NIL;
    67     slots[StandardGenericFunctionClass.SLOT_INDEX_DECLARATIONS] = NIL;
    68     slots[StandardGenericFunctionClass.SLOT_INDEX_CLASSES_TO_EMF_TABLE] = NIL;
    69     slots[StandardGenericFunctionClass.SLOT_INDEX_DOCUMENTATION] = NIL;
     55    setInstanceSlotValue(Symbol.NAME, NIL);
     56    setInstanceSlotValue(Symbol.LAMBDA_LIST, NIL);
     57    setInstanceSlotValue(Symbol.REQUIRED_ARGS, NIL);
     58    setInstanceSlotValue(Symbol.OPTIONAL_ARGS, NIL);
     59    setInstanceSlotValue(Symbol.INITIAL_METHODS, NIL);
     60    setInstanceSlotValue(Symbol.METHODS, NIL);
     61    setInstanceSlotValue(Symbol.METHOD_CLASS, StandardClass.STANDARD_METHOD);
     62    // method combination class set by clos.lisp:shared-initialize :after
     63    setInstanceSlotValue(Symbol._METHOD_COMBINATION, list(Symbol.STANDARD));
     64    setInstanceSlotValue(Symbol.ARGUMENT_PRECEDENCE_ORDER, NIL);
     65    setInstanceSlotValue(Symbol.DECLARATIONS, NIL);
     66    setInstanceSlotValue(Symbol.CLASSES_TO_EMF_TABLE, NIL);
     67    setInstanceSlotValue(Symbol._DOCUMENTATION, NIL);
    7068  }
    7169
     
    7775  public LispObject getName()
    7876  {
    79     return slots[StandardGenericFunctionClass.SLOT_INDEX_NAME];
     77    return getInstanceSlotValue(Symbol.NAME);
    8078  }
    8179
    8280  public void setName(LispObject name)
    8381  {
    84     slots[StandardGenericFunctionClass.SLOT_INDEX_NAME] = name;
     82    setInstanceSlotValue(Symbol.NAME, name);
    8583  }
    8684
     
    163161      LispObject args = second;
    164162      int numberOfRequiredArgs
    165         = gf.slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS]
    166         .length();
     163        = gf.getInstanceSlotValue(Symbol.REQUIRED_ARGS).length();
    167164      LispObject[] array = new LispObject[numberOfRequiredArgs];
    168165      for (int i = numberOfRequiredArgs; i-- > 0;)
     
    195192      LispObject args = second;
    196193      int numberOfRequiredArgs
    197         = gf.slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS]
    198         .length();
     194        = gf.getInstanceSlotValue(Symbol.REQUIRED_ARGS).length();
    199195      LispObject[] array = new LispObject[numberOfRequiredArgs];
    200196      for (int i = numberOfRequiredArgs; i-- > 0;)
  • trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java

    r14470 r14474  
    3838public final class StandardGenericFunctionClass extends FuncallableStandardClass
    3939{
    40   public static final int SLOT_INDEX_NAME                      = 0;
    41   public static final int SLOT_INDEX_LAMBDA_LIST               = 1;
    42   public static final int SLOT_INDEX_REQUIRED_ARGS             = 2;
    43   public static final int SLOT_INDEX_OPTIONAL_ARGS             = 3;
    44   public static final int SLOT_INDEX_INITIAL_METHODS           = 4;
    45   public static final int SLOT_INDEX_METHODS                   = 5;
    46   public static final int SLOT_INDEX_METHOD_CLASS              = 6;
    47   public static final int SLOT_INDEX_METHOD_COMBINATION        = 7;
    48   public static final int SLOT_INDEX_ARGUMENT_PRECEDENCE_ORDER = 8;
    49   public static final int SLOT_INDEX_DECLARATIONS              = 9;
    50   public static final int SLOT_INDEX_CLASSES_TO_EMF_TABLE      = 10;
    51   public static final int SLOT_INDEX_DOCUMENTATION             = 11;
    52 
    5340  public StandardGenericFunctionClass()
    5441  {
Note: See TracChangeset for help on using the changeset viewer.