Changeset 14086


Ignore:
Timestamp:
08/14/12 12:40:56 (9 years ago)
Author:
rschlatte
Message:

Eliminate numberOfRequiredArgs attribute from standard generic function

  • calculate it when required instead
Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r13888 r14086  
    4242{
    4343  protected LispObject function;
    44   protected int numberOfRequiredArgs;
    4544
    4645  protected FuncallableStandardObject()
  • trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java

    r14008 r14086  
    5757    slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS] = NIL;
    5858    slots[StandardGenericFunctionClass.SLOT_INDEX_OPTIONAL_ARGS] = NIL;
    59     numberOfRequiredArgs = 0;
    6059    slots[StandardGenericFunctionClass.SLOT_INDEX_INITIAL_METHODS] = NIL;
    6160    slots[StandardGenericFunctionClass.SLOT_INDEX_METHODS] = NIL;
     
    229228      final StandardGenericFunction gf = checkStandardGenericFunction(first);
    230229      gf.slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS] = second;
    231       gf.numberOfRequiredArgs = second.length();
    232230      return second;
    233231    }
     
    578576      final StandardGenericFunction gf = checkStandardGenericFunction(first);
    579577      LispObject args = second;
    580       LispObject[] array = new LispObject[gf.numberOfRequiredArgs];
    581       for (int i = gf.numberOfRequiredArgs; i-- > 0;)
     578      int numberOfRequiredArgs
     579        = gf.slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS]
     580        .length();
     581      LispObject[] array = new LispObject[numberOfRequiredArgs];
     582      for (int i = numberOfRequiredArgs; i-- > 0;)
    582583        {
    583584          array[i] = gf.getArgSpecialization(args.car());
     
    607608      final StandardGenericFunction gf = checkStandardGenericFunction(first);
    608609      LispObject args = second;
    609       LispObject[] array = new LispObject[gf.numberOfRequiredArgs];
    610       for (int i = gf.numberOfRequiredArgs; i-- > 0;)
     610      int numberOfRequiredArgs
     611        = gf.slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS]
     612        .length();
     613      LispObject[] array = new LispObject[numberOfRequiredArgs];
     614      for (int i = numberOfRequiredArgs; i-- > 0;)
    611615        {
    612616          array[i] = gf.getArgSpecialization(args.car());
Note: See TracChangeset for help on using the changeset viewer.