Changeset 14468


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

Fix set-lambda-name & friends

  • in funcallable-standard-object, delegate to the real function, don't access potentially non-existing slots
Location:
trunk/abcl/src/org/armedbear/lisp
Files:
4 edited

Legend:

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

    r14464 r14468  
    3838public class FuncallableStandardClass extends StandardClass
    3939{
    40   public static final int SLOT_INDEX_NAME                      = 0;
    41 
    4240  public FuncallableStandardClass()
    4341  {
  • trunk/abcl/src/org/armedbear/lisp/FuncallableStandardObject.java

    r14465 r14468  
    4141public class FuncallableStandardObject extends StandardObject
    4242{
    43   protected LispObject function;
     43  LispObject function;
    4444
    4545  protected FuncallableStandardObject()
     
    8686    return super.typep(type);
    8787  }
    88 
    89   public LispObject getName()
    90   {
    91     return slots[FuncallableStandardClass.SLOT_INDEX_NAME];
    92   }
    93 
    94   public void setName(LispObject name)
    95   {
    96     slots[FuncallableStandardClass.SLOT_INDEX_NAME] = name;
    97   }
    98 
    9988
    10089  @Override
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r14465 r14468  
    26582658                value2 = T;
    26592659                value3 = ((Function)arg).getLambdaName();
    2660             } else if (arg instanceof FuncallableStandardObject) {
     2660            } else if (arg instanceof StandardGenericFunction) {
    26612661                value1 = NIL;
    26622662                value2 = T;
    2663                 value3 = ((FuncallableStandardObject)arg).getName();
    2664             } else
    2665                 return type_error(arg, Symbol.FUNCTION);
     2663                value3 = ((StandardGenericFunction)arg).getName();
     2664            } else if (arg instanceof FuncallableStandardObject) {
     2665              return this.execute(((FuncallableStandardObject)arg).function);
     2666            } else {
     2667              return type_error(arg, Symbol.FUNCTION);
     2668            }
    26662669            return LispThread.currentThread().setValues(value1, value2, value3);
    26672670        }
     
    42184221                return ((Operator)arg).getLambdaName();
    42194222            }
     4223            if (arg instanceof StandardGenericFunction) {
     4224                return ((StandardGenericFunction)arg).getName();
     4225            }
    42204226            if (arg instanceof FuncallableStandardObject) {
    4221                 return ((FuncallableStandardObject)arg).getName();
     4227              return this.execute(((FuncallableStandardObject)arg).function);
    42224228            }
    42234229            return type_error(arg, Symbol.FUNCTION);
     
    42404246                return second;
    42414247            }
     4248            if (first instanceof StandardGenericFunction) {
     4249                ((StandardGenericFunction)first).setName(second);
     4250                return second;
     4251            }
    42424252            if (first instanceof FuncallableStandardObject) {
    4243                 ((FuncallableStandardObject)first).setName(second);
    4244                 return second;
     4253              return this.execute(((FuncallableStandardObject)first).function, second);
    42454254            }
    42464255            return type_error(first, Symbol.FUNCTION);
  • trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java

    r14454 r14468  
    7575  }
    7676
     77  public LispObject getName()
     78  {
     79    return slots[StandardGenericFunctionClass.SLOT_INDEX_NAME];
     80  }
     81
     82  public void setName(LispObject name)
     83  {
     84    slots[StandardGenericFunctionClass.SLOT_INDEX_NAME] = name;
     85  }
     86
     87
    7788  @Override
    7889  public LispObject typep(LispObject type)
Note: See TracChangeset for help on using the changeset viewer.