Changeset 10308


Ignore:
Timestamp:
11/01/05 09:44:19 (16 years ago)
Author:
piso
Message:

TYPE-ERROR-DATUM, TYPE-ERROR-EXPECTED-TYPE

File:
1 edited

Legend:

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

    r10304 r10308  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: TypeError.java,v 1.33 2005-11-01 01:35:13 piso Exp $
     5 * $Id: TypeError.java,v 1.34 2005-11-01 09:44:19 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    194194    // ### type-error-datum
    195195    private static final Primitive TYPE_ERROR_DATUM =
    196         new Primitive("type-error-datum", "condition")
     196        new Primitive(Symbol.TYPE_ERROR_DATUM, "condition")
    197197    {
    198198        public LispObject execute(LispObject arg) throws ConditionThrowable
    199199        {
     200            final StandardObject obj;
    200201            try {
    201                 return ((TypeError)arg).getDatum();
     202                obj = (StandardObject) arg;
    202203            }
    203204            catch (ClassCastException e) {
    204                 return signalTypeError(arg, Symbol.TYPE_ERROR);
    205             }
     205                return signalTypeError(arg, Symbol.STANDARD_OBJECT);
     206            }
     207            return obj.getInstanceSlotValue(Symbol.DATUM);
    206208        }
    207209    };
     
    209211    // ### type-error-expected-type
    210212    private static final Primitive TYPE_ERROR_EXPECTED_TYPE =
    211         new Primitive("type-error-expected-type", "condition")
     213        new Primitive(Symbol.TYPE_ERROR_EXPECTED_TYPE, "condition")
    212214    {
    213215        public LispObject execute(LispObject arg) throws ConditionThrowable
    214216        {
     217            final StandardObject obj;
    215218            try {
    216                 return ((TypeError)arg).getExpectedType();
     219                obj = (StandardObject) arg;
    217220            }
    218221            catch (ClassCastException e) {
    219                 return signalTypeError(arg, Symbol.TYPE_ERROR);
    220             }
     222                return signalTypeError(arg, Symbol.STANDARD_OBJECT);
     223            }
     224            return obj.getInstanceSlotValue(Symbol.EXPECTED_TYPE);
    221225        }
    222226    };
Note: See TracChangeset for help on using the changeset viewer.