Changeset 14469


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

invoke slot-missing from getInstanceSlotValue, setInstanceSlotValue

File:
1 edited

Legend:

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

    r14465 r14469  
    303303    Debug.assertTrue(layout != null);
    304304    int index = layout.getSlotIndex(slotName);
    305     //### FIXME: should call SLOT-MISSING (clhs)
    306     if (index < 0)
    307       return error(new LispError("Missing slot " + slotName.princToString()));
     305    if (index < 0) {
     306      // Not found.
     307      final LispThread thread = LispThread.currentThread();
     308      // If the operation is slot-value, only the primary value [of
     309      // slot-missing] will be used by the caller, and all other values
     310      // will be ignored.
     311      LispObject value = thread.execute(Symbol.SLOT_MISSING,
     312                                        this.getLispClass(), this,
     313                                        slotName, Symbol.SLOT_VALUE);
     314      thread._values = null;
     315      return value;
     316    }
    308317    return slots[index];
    309318  }
     
    321330    Debug.assertTrue(layout != null);
    322331    int index = layout.getSlotIndex(slotName);
    323     // FIXME: should call SLOT-MISSING (clhs)
    324     if (index < 0)
    325       error(new LispError("Missing slot " + slotName.princToString()));
     332    if (index < 0) {
     333      // Not found.
     334      final LispThread thread = LispThread.currentThread();
     335      // If the operation is setf or slot-makunbound, any values
     336      // [returned by slot-missing] will be ignored by the caller.
     337      thread.execute(Symbol.SLOT_MISSING, this.getLispClass(), this,
     338                     slotName, Symbol.SETF, newValue);
     339      thread._values = null;
     340    }
    326341    slots[index] = newValue;
    327342  }
Note: See TracChangeset for help on using the changeset viewer.