Changeset 3947


Ignore:
Timestamp:
09/21/03 01:57:31 (19 years ago)
Author:
piso
Message:

extends LispError? => extends CellError?

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r3929 r3947  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: UnboundVariable.java,v 1.2 2003-09-20 17:02:05 piso Exp $
     5 * $Id: UnboundVariable.java,v 1.3 2003-09-21 01:56:58 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2222package org.armedbear.lisp;
    2323
    24 public final class UnboundVariable extends LispError
     24public final class UnboundVariable extends CellError
    2525{
    26     private final String name;
    27 
    28     public UnboundVariable(String name)
     26    // obj is either the unbound variable itself or an initArgs list.
     27    public UnboundVariable(LispObject obj) throws ConditionThrowable
    2928    {
    30         this.name = name;
     29        super(obj instanceof Cons ? obj : list2(Keyword.NAME, obj));
    3130    }
    3231
    3332    public String getMessage()
    3433    {
    35         if (name == null)
    36             return "unbound variable";
    37         return "the variable " + name + " has no value";
     34        return "the variable " + getCellName() + " has no value";
    3835    }
    3936
  • trunk/j/src/org/armedbear/lisp/UndefinedFunction.java

    r3945 r3947  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: UndefinedFunction.java,v 1.3 2003-09-21 01:41:51 piso Exp $
     5 * $Id: UndefinedFunction.java,v 1.4 2003-09-21 01:57:31 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2222package org.armedbear.lisp;
    2323
    24 public final class UndefinedFunction extends LispError
     24public final class UndefinedFunction extends CellError
    2525{
    26     private final LispObject object;
    27     private final String name;
    28 
    29     public UndefinedFunction(LispObject object)
     26    // obj is either the undefined function itself or an initArgs list.
     27    public UndefinedFunction(LispObject obj) throws ConditionThrowable
    3028    {
    31         this.object = object;
    32         this.name = null;
     29        super(obj instanceof Cons ? obj : list2(Keyword.NAME, obj));
    3330    }
    3431
     
    4744        if (type == Symbol.UNDEFINED_FUNCTION)
    4845            return T;
     46        if (type == BuiltInClass.UNDEFINED_FUNCTION)
     47            return T;
    4948        return super.typep(type);
    5049    }
     
    5352    {
    5453        StringBuffer sb = new StringBuffer("undefined function");
    55         if (name != null) {
    56             sb.append(' ');
    57             sb.append(name);
    58         } else if (object != null) {
    59             sb.append(' ');
    60             sb.append(String.valueOf(object));
    61         }
     54        sb.append(' ');
     55        sb.append(String.valueOf(getCellName()));
    6256        return sb.toString();
    6357    }
Note: See TracChangeset for help on using the changeset viewer.