Changeset 10320


Ignore:
Timestamp:
11/02/05 01:11:57 (16 years ago)
Author:
piso
Message:

A CELL-ERROR might not be instanceof CellError?, but it is always instanceof StandardObject?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/cell_error_name.java

    r8087 r10320  
    22 * cell_error_name.java
    33 *
    4  * Copyright (C) 2003-2004 Peter Graves
    5  * $Id: cell_error_name.java,v 1.4 2004-11-03 15:39:02 piso Exp $
     4 * Copyright (C) 2003-2005 Peter Graves
     5 * $Id: cell_error_name.java,v 1.5 2005-11-02 01:11:57 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2727    private cell_error_name()
    2828    {
    29         super("cell-error-name");
     29        super(Symbol.CELL_ERROR_NAME, "condition");
    3030    }
    3131
    3232    public LispObject execute(LispObject arg) throws ConditionThrowable
    3333    {
    34         if (arg instanceof CellError)
    35             return ((CellError)arg).getCellName();
    36         return signal(new TypeError(arg, Symbol.CELL_ERROR));
     34        final StandardObject obj;
     35        try {
     36            obj = (StandardObject) arg;
     37        }
     38        catch (ClassCastException e) {
     39            return signalTypeError(arg, Symbol.STANDARD_OBJECT);
     40        }
     41        return obj.getInstanceSlotValue(Symbol.NAME);
    3742    }
    3843
    39     private static final cell_error_name CELL_ERROR_NAME = new cell_error_name();
     44    private static final Primitive CELL_ERROR_NAME = new cell_error_name();
    4045}
Note: See TracChangeset for help on using the changeset viewer.