1 21 22 package org.armedbear.lisp; 23 24 public final class UndefinedFunction extends CellError 25 { 26 public UndefinedFunction(LispObject obj) throws ConditionThrowable 28 { 29 super(obj instanceof Cons ? obj : list2(Keyword.NAME, obj)); 30 } 31 32 public LispObject typeOf() 33 { 34 return Symbol.UNDEFINED_FUNCTION; 35 } 36 37 public LispClass classOf() 38 { 39 return BuiltInClass.UNDEFINED_FUNCTION; 40 } 41 42 public LispObject typep(LispObject type) throws ConditionThrowable 43 { 44 if (type == Symbol.UNDEFINED_FUNCTION) 45 return T; 46 if (type == BuiltInClass.UNDEFINED_FUNCTION) 47 return T; 48 return super.typep(type); 49 } 50 51 public String getMessage() 52 { 53 LispObject cellName = getCellName(); 54 StringBuffer sb = new StringBuffer ("The function "); 55 try { 57 sb.append(cellName.writeToString()); 58 } 59 catch (Throwable t) {} 60 sb.append(" is undefined."); 61 return sb.toString(); 62 } 63 64 public String writeToString() throws ConditionThrowable 65 { 66 if (_PRINT_ESCAPE_.symbolValue() == NIL) 67 return super.writeToString(); 68 StringBuffer sb = new StringBuffer ("UNDEFINED-FUNCTION "); 69 sb.append(getCellName().writeToString()); 70 return unreadableString(sb.toString()); 71 } 72 } 73 | Popular Tags |