Changeset 14008


Ignore:
Timestamp:
07/15/12 10:38:05 (8 years ago)
Author:
rschlatte
Message:

Eliminate Java-side definition of generic functions

... which was used only once in the entire codebase

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

Legend:

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

    r13983 r14008  
    7171  }
    7272
    73   public StandardGenericFunction(String name, Package pkg, boolean exported,
    74                                  Function function, LispObject lambdaList,
    75                                  LispObject specializers)
    76   {
    77     this();
    78     Symbol symbol;
    79     if (exported)
    80       symbol = pkg.internAndExport(name.toUpperCase());
    81     else
    82       symbol = pkg.intern(name.toUpperCase());
    83     symbol.setSymbolFunction(this);
    84     this.function = function;
    85     slots[StandardGenericFunctionClass.SLOT_INDEX_NAME] = symbol;
    86     slots[StandardGenericFunctionClass.SLOT_INDEX_LAMBDA_LIST] =
    87       lambdaList;
    88     slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS] =
    89       lambdaList;
    90     slots[StandardGenericFunctionClass.SLOT_INDEX_OPTIONAL_ARGS] =
    91       NIL;
    92     numberOfRequiredArgs = lambdaList.length();
    93     slots[StandardGenericFunctionClass.SLOT_INDEX_INITIAL_METHODS] =
    94       NIL;
    95     StandardObject method
    96         = (StandardObject)StandardClass.STANDARD_METHOD.allocateInstance();
    97     method.setInstanceSlotValue(Symbol._GENERIC_FUNCTION, this);
    98     method.setInstanceSlotValue(Symbol.LAMBDA_LIST, lambdaList);
    99     method.setInstanceSlotValue(Symbol.KEYWORDS, NIL);
    100     method.setInstanceSlotValue(Symbol.OTHER_KEYWORDS_P, NIL);
    101     method.setInstanceSlotValue(Symbol.SPECIALIZERS, specializers);
    102     method.setInstanceSlotValue(Symbol.QUALIFIERS, NIL);
    103     // Setting the function slot to nil is a transcription of what the
    104     // constructor for StandardMethod instances did (that Java class was
    105     // removed for the implementation of subclassable standard-method).
    106     // (rudi 2012-01-27)
    107     method.setInstanceSlotValue(Symbol._FUNCTION, NIL);
    108     method.setInstanceSlotValue(Symbol.FAST_FUNCTION, function);
    109     method.setInstanceSlotValue(Symbol._DOCUMENTATION, NIL);
    110     slots[StandardGenericFunctionClass.SLOT_INDEX_METHODS] =
    111       list(method);
    112     slots[StandardGenericFunctionClass.SLOT_INDEX_METHOD_CLASS] =
    113       StandardClass.STANDARD_METHOD;
    114     slots[StandardGenericFunctionClass.SLOT_INDEX_METHOD_COMBINATION] =
    115       Symbol.STANDARD; // fixed up by shared-initialize :after in clos.lisp
    116     slots[StandardGenericFunctionClass.SLOT_INDEX_ARGUMENT_PRECEDENCE_ORDER] =
    117       NIL;
    118     slots[StandardGenericFunctionClass.SLOT_INDEX_DECLARATIONS] = NIL;
    119     slots[StandardGenericFunctionClass.SLOT_INDEX_CLASSES_TO_EMF_TABLE] =
    120       NIL;
    121     slots[StandardGenericFunctionClass.SLOT_INDEX_DOCUMENTATION] = NIL;
    122   }
    123 
    12473  void finalizeInternal()
    12574  {
     
    804753  };
    805754
    806   private static final StandardGenericFunction GENERIC_FUNCTION_NAME =
    807     new StandardGenericFunction("generic-function-name",
    808                                 PACKAGE_MOP,
    809                                 true,
    810                                 _GENERIC_FUNCTION_NAME,
    811                                 list(Symbol.GENERIC_FUNCTION),
    812                                 list(StandardClass.STANDARD_GENERIC_FUNCTION));
    813 
    814755  private static class CacheEntry
    815756  {
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r14007 r14008  
    14731473;;; These are defined with % in package SYS, defined as functions here
    14741474;;; and redefined as generic functions once we're all set up.
     1475
     1476(defun generic-function-name (gf)
     1477  (%generic-function-name gf))
    14751478
    14761479(defun generic-function-lambda-list (gf)
Note: See TracChangeset for help on using the changeset viewer.