Changeset 14494


Ignore:
Timestamp:
05/07/13 08:01:24 (10 years ago)
Author:
rschlatte
Message:

Remove casts to StandardGenericFunction?

Replaced with function invocations / slot access.

Also remove some outdated comments.

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

Legend:

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

    r14493 r14494  
    26582658                value2 = T;
    26592659                value3 = ((Function)arg).getLambdaName();
    2660             } else if (arg instanceof StandardGenericFunction) {
     2660            } else if (arg.typep(StandardClass.GENERIC_FUNCTION) != NIL) {
    26612661                value1 = NIL;
    26622662                value2 = T;
    2663                 value3 = ((StandardGenericFunction)arg).getInstanceSlotValue(Symbol.NAME);
     2663                value3 = Symbol.GENERIC_FUNCTION_NAME.execute(arg);
    26642664            } else if (arg instanceof FuncallableStandardObject) {
    26652665              return this.execute(((FuncallableStandardObject)arg).function);
     
    42214221                return ((Operator)arg).getLambdaName();
    42224222            }
    4223             if (arg instanceof StandardGenericFunction) {
    4224                 return ((StandardGenericFunction)arg).getInstanceSlotValue(Symbol.NAME);
     4223            if (arg.typep(StandardClass.GENERIC_FUNCTION) != NIL) {
     4224                return Symbol.GENERIC_FUNCTION_NAME.execute(arg);
    42254225            }
    42264226            if (arg instanceof FuncallableStandardObject) {
     
    42464246                return second;
    42474247            }
    4248             if (first instanceof StandardGenericFunction) {
    4249                 ((StandardGenericFunction)first).setInstanceSlotValue(Symbol.NAME, second);
     4248            // KLUDGE: this isn't fully general, but lots of other stuff
     4249            // will break for generic functions that aren't subclasses
     4250            // of standard-generic-function as well.
     4251            if (first.typep(StandardClass.STANDARD_GENERIC_FUNCTION) != NIL) {
     4252                ((StandardObject)first).setInstanceSlotValue(Symbol.NAME, second);
    42504253                return second;
    42514254            }
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r14490 r14494  
    30063006  public static final Symbol GENERIC_FUNCTION_METHODS =
    30073007    PACKAGE_MOP.addExternalSymbol("GENERIC-FUNCTION-METHODS");
     3008  public static final Symbol GENERIC_FUNCTION_NAME =
     3009    PACKAGE_MOP.addExternalSymbol("GENERIC-FUNCTION-NAME");
    30083010  public static final Symbol METAOBJECT =
    30093011    PACKAGE_MOP.addExternalSymbol("METAOBJECT");
  • trunk/abcl/src/org/armedbear/lisp/mop.lisp

    r14103 r14494  
    1 ;;;; Does not currently include all the MOP, but it should.
     1
    22
    33(in-package #:mop)
    4 
    5 ;;; StandardGenericFunction.java defines FUNCALLABLE-INSTANCE-FUNCTION and
    6 ;;; SET-FUNCALLABLE-INSTANCE-FUNCTION.
    7 ;;;
    8 ;;; TODO
    9 ;;;
    10 ;;;   1. Verify that we can make FUNCALLABLE-STANDARD-CLASS instances
    11 ;;;      which work.
    12 ;;;
    13 ;;;   2. Tighten the type checks so that only instances of
    14 ;;;      FUNCALLABLE-STANDARD-CLASS are callable.
    154
    165;;; AMOP pg. 240ff.
Note: See TracChangeset for help on using the changeset viewer.