Changeset 3902
- Timestamp:
- 09/19/03 16:04:50 (19 years ago)
- Location:
- trunk/j/src/org/armedbear/lisp
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/ArithmeticError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: ArithmeticError.java,v 1. 4 2003-09-19 14:55:06piso Exp $5 * $Id: ArithmeticError.java,v 1.5 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 33 33 } 34 34 35 public LispObject typeOf() 36 { 37 return Symbol.ARITHMETIC_ERROR; 38 } 39 40 public LispClass classOf() 41 { 42 return LispClass.ARITHMETIC_ERROR; 43 } 44 35 45 public LispObject typep(LispObject type) throws ConditionThrowable 36 46 { -
trunk/j/src/org/armedbear/lisp/Condition.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Condition.java,v 1. 6 2003-09-19 14:55:06piso Exp $5 * $Id: Condition.java,v 1.7 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 57 57 return super.typep(type); 58 58 } 59 60 public String toString() 61 { 62 if (_PRINT_ESCAPE_.symbolValueNoThrow() == NIL) { 63 String s = getMessage(); 64 if (s != null) 65 return s; 66 } 67 StringBuffer sb = new StringBuffer("#<"); 68 sb.append(typeOf()); 69 sb.append(" @ "); 70 sb.append(Integer.toHexString(hashCode())); 71 sb.append(">"); 72 return sb.toString(); 73 } 59 74 } -
trunk/j/src/org/armedbear/lisp/ControlError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: ControlError.java,v 1. 3 2003-09-19 14:55:06piso Exp $5 * $Id: ControlError.java,v 1.4 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 33 33 } 34 34 35 public LispObject typeOf() 36 { 37 return Symbol.CONTROL_ERROR; 38 } 39 40 public LispClass classOf() 41 { 42 return LispClass.CONTROL_ERROR; 43 } 44 35 45 public LispObject typep(LispObject type) throws ConditionThrowable 36 46 { -
trunk/j/src/org/armedbear/lisp/Lisp.java
r3894 r3902 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Lisp.java,v 1.1 39 2003-09-19 14:44:10 piso Exp $5 * $Id: Lisp.java,v 1.140 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 275 275 result = obj.getSymbolValue(); 276 276 if (result == null) 277 throw new ConditionThrowable(new UnboundVariable Exception(obj.getName()));277 throw new ConditionThrowable(new UnboundVariable(obj.getName())); 278 278 } 279 279 return result; … … 283 283 LispObject fun = env.lookupFunctional(first); 284 284 if (fun == null) 285 throw new ConditionThrowable(new UndefinedFunction Error(first));285 throw new ConditionThrowable(new UndefinedFunction(first)); 286 286 switch (fun.getFunctionalType()) { 287 287 case FTYPE_SPECIAL_OPERATOR: { … … 759 759 } else if (obj instanceof Cons && obj.car() == Symbol.LAMBDA) 760 760 return new Closure(obj.cadr(), obj.cddr(), new Environment()); 761 throw new ConditionThrowable(new UndefinedFunction Error(obj));761 throw new ConditionThrowable(new UndefinedFunction(obj)); 762 762 } 763 763 -
trunk/j/src/org/armedbear/lisp/LispClass.java
r3884 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispClass.java,v 1.1 5 2003-09-19 11:50:18piso Exp $5 * $Id: LispClass.java,v 1.16 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 66 66 67 67 // We can't call this class T! 68 public static final LispClass CLASS_T = addClass(T);68 public static final LispClass CLASS_T = addClass(T); 69 69 70 public static final LispClass ARRAY = addClass(Symbol.ARRAY); 71 public static final LispClass BIGNUM = addClass(Symbol.BIGNUM); 72 public static final LispClass BIT_VECTOR = addClass(Symbol.BIT_VECTOR); 73 public static final LispClass BUILT_IN_CLASS = addClass(Symbol.BUILT_IN_CLASS); 74 public static final LispClass CHARACTER = addClass(Symbol.CHARACTER); 75 public static final LispClass CLASS = addClass(Symbol.CLASS); 76 public static final LispClass COMPLEX = addClass(Symbol.COMPLEX); 77 public static final LispClass CONDITION = addClass(Symbol.CONDITION); 78 public static final LispClass CONS = addClass(Symbol.CONS); 79 public static final LispClass FIXNUM = addClass(Symbol.FIXNUM); 80 public static final LispClass FLOAT = addClass(Symbol.FLOAT); 81 public static final LispClass FUNCTION = addClass(Symbol.FUNCTION); 82 public static final LispClass HASH_TABLE = addClass(Symbol.HASH_TABLE); 83 public static final LispClass INTEGER = addClass(Symbol.INTEGER); 84 public static final LispClass LIST = addClass(Symbol.LIST); 85 public static final LispClass NULL = addClass(Symbol.NULL); 86 public static final LispClass NUMBER = addClass(Symbol.NUMBER); 87 public static final LispClass PACKAGE = addClass(Symbol.PACKAGE); 88 public static final LispClass PATHNAME = addClass(Symbol.PATHNAME); 89 public static final LispClass RANDOM_STATE = addClass(Symbol.RANDOM_STATE); 90 public static final LispClass RATIO = addClass(Symbol.RATIO); 91 public static final LispClass RATIONAL = addClass(Symbol.RATIONAL); 92 public static final LispClass REAL = addClass(Symbol.REAL); 93 public static final LispClass SEQUENCE = addClass(Symbol.SEQUENCE); 94 public static final LispClass STANDARD_CLASS = addClass(Symbol.STANDARD_CLASS); 95 public static final LispClass STANDARD_OBJECT = addClass(Symbol.STANDARD_OBJECT); 96 public static final LispClass STREAM = addClass(Symbol.STREAM); 97 public static final LispClass STRING = addClass(Symbol.STRING); 98 public static final LispClass STRING_STREAM = addClass(Symbol.STRING_STREAM); 99 public static final LispClass STRUCTURE_CLASS = addClass(Symbol.STRUCTURE_CLASS); 100 public static final LispClass STRUCTURE_OBJECT = addClass(Symbol.STRUCTURE_OBJECT); 101 public static final LispClass SYMBOL = addClass(Symbol.SYMBOL); 102 public static final LispClass TWO_WAY_STREAM = addClass(Symbol.TWO_WAY_STREAM); 103 public static final LispClass VECTOR = addClass(Symbol.VECTOR); 70 public static final LispClass ARITHMETIC_ERROR = addClass(Symbol.ARITHMETIC_ERROR); 71 public static final LispClass ARRAY = addClass(Symbol.ARRAY); 72 public static final LispClass BIGNUM = addClass(Symbol.BIGNUM); 73 public static final LispClass BIT_VECTOR = addClass(Symbol.BIT_VECTOR); 74 public static final LispClass BUILT_IN_CLASS = addClass(Symbol.BUILT_IN_CLASS); 75 public static final LispClass CHARACTER = addClass(Symbol.CHARACTER); 76 public static final LispClass CLASS = addClass(Symbol.CLASS); 77 public static final LispClass COMPLEX = addClass(Symbol.COMPLEX); 78 public static final LispClass CONDITION = addClass(Symbol.CONDITION); 79 public static final LispClass CONS = addClass(Symbol.CONS); 80 public static final LispClass CONTROL_ERROR = addClass(Symbol.CONTROL_ERROR); 81 public static final LispClass FIXNUM = addClass(Symbol.FIXNUM); 82 public static final LispClass FLOAT = addClass(Symbol.FLOAT); 83 public static final LispClass FUNCTION = addClass(Symbol.FUNCTION); 84 public static final LispClass HASH_TABLE = addClass(Symbol.HASH_TABLE); 85 public static final LispClass INTEGER = addClass(Symbol.INTEGER); 86 public static final LispClass LIST = addClass(Symbol.LIST); 87 public static final LispClass NULL = addClass(Symbol.NULL); 88 public static final LispClass NUMBER = addClass(Symbol.NUMBER); 89 public static final LispClass PACKAGE = addClass(Symbol.PACKAGE); 90 public static final LispClass PACKAGE_ERROR = addClass(Symbol.PACKAGE_ERROR); 91 public static final LispClass PARSE_ERROR = addClass(Symbol.PARSE_ERROR); 92 public static final LispClass PATHNAME = addClass(Symbol.PATHNAME); 93 public static final LispClass PROGRAM_ERROR = addClass(Symbol.PROGRAM_ERROR); 94 public static final LispClass RANDOM_STATE = addClass(Symbol.RANDOM_STATE); 95 public static final LispClass RATIO = addClass(Symbol.RATIO); 96 public static final LispClass RATIONAL = addClass(Symbol.RATIONAL); 97 public static final LispClass REAL = addClass(Symbol.REAL); 98 public static final LispClass SEQUENCE = addClass(Symbol.SEQUENCE); 99 public static final LispClass SIMPLE_ERROR = addClass(Symbol.SIMPLE_ERROR); 100 public static final LispClass STANDARD_CLASS = addClass(Symbol.STANDARD_CLASS); 101 public static final LispClass STANDARD_OBJECT = addClass(Symbol.STANDARD_OBJECT); 102 public static final LispClass STREAM = addClass(Symbol.STREAM); 103 public static final LispClass STREAM_ERROR = addClass(Symbol.STREAM_ERROR); 104 public static final LispClass STRING = addClass(Symbol.STRING); 105 public static final LispClass STRING_STREAM = addClass(Symbol.STRING_STREAM); 106 public static final LispClass STRUCTURE_CLASS = addClass(Symbol.STRUCTURE_CLASS); 107 public static final LispClass STRUCTURE_OBJECT = addClass(Symbol.STRUCTURE_OBJECT); 108 public static final LispClass SYMBOL = addClass(Symbol.SYMBOL); 109 public static final LispClass TWO_WAY_STREAM = addClass(Symbol.TWO_WAY_STREAM); 110 public static final LispClass TYPE_ERROR = addClass(Symbol.TYPE_ERROR); 111 public static final LispClass UNBOUND_VARIABLE = addClass(Symbol.UNBOUND_VARIABLE); 112 public static final LispClass UNDEFINED_FUNCTION = addClass(Symbol.UNDEFINED_FUNCTION); 113 public static final LispClass VECTOR = addClass(Symbol.VECTOR); 104 114 105 115 public static LispClass findClass(Symbol symbol) -
trunk/j/src/org/armedbear/lisp/LispError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: LispError.java,v 1. 4 2003-09-19 14:55:06piso Exp $5 * $Id: LispError.java,v 1.5 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 33 33 } 34 34 35 public LispObject typeOf() 36 { 37 return Symbol.ERROR; 38 } 39 35 40 public LispObject typep(LispObject type) throws ConditionThrowable 36 41 { -
trunk/j/src/org/armedbear/lisp/PackageError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: PackageError.java,v 1. 4 2003-09-19 14:55:06piso Exp $5 * $Id: PackageError.java,v 1.5 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 33 33 } 34 34 35 public LispObject typeOf() 36 { 37 return Symbol.PACKAGE_ERROR; 38 } 39 40 public LispClass classOf() 41 { 42 return LispClass.PACKAGE_ERROR; 43 } 44 35 45 public LispObject typep(LispObject type) throws ConditionThrowable 36 46 { -
trunk/j/src/org/armedbear/lisp/ParseError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: ParseError.java,v 1. 5 2003-09-19 14:55:06piso Exp $5 * $Id: ParseError.java,v 1.6 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 29 29 } 30 30 31 public LispObject typeOf() 32 { 33 return Symbol.PARSE_ERROR; 34 } 35 36 public LispClass classOf() 37 { 38 return LispClass.PARSE_ERROR; 39 } 40 31 41 public LispObject typep(LispObject type) throws ConditionThrowable 32 42 { -
trunk/j/src/org/armedbear/lisp/Primitives.java
r3894 r3902 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.41 3 2003-09-19 14:44:10 piso Exp $5 * $Id: Primitives.java,v 1.414 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 306 306 if (function != null) 307 307 return function; 308 throw new ConditionThrowable(new UndefinedFunction Error(arg));308 throw new ConditionThrowable(new UndefinedFunction(arg)); 309 309 } 310 310 case SYMBOL_PLIST: // ### symbol-plist … … 1728 1728 handler = obj.getSymbolFunction(); 1729 1729 if (handler == null) 1730 throw new ConditionThrowable(new UndefinedFunction Error(obj));1730 throw new ConditionThrowable(new UndefinedFunction(obj)); 1731 1731 } else 1732 1732 handler = obj; … … 1794 1794 return c.getCondition() instanceof StreamError; 1795 1795 if (type == Symbol.UNDEFINED_FUNCTION) 1796 return c.getCondition() instanceof UndefinedFunction Error;1796 return c.getCondition() instanceof UndefinedFunction; 1797 1797 if (type == Symbol.TYPE_ERROR) 1798 1798 return c.getCondition() instanceof TypeError; … … 2226 2226 if (fun instanceof Function) 2227 2227 return funcall0(fun, LispThread.currentThread()); 2228 throw new ConditionThrowable(new UndefinedFunction Error(arg));2228 throw new ConditionThrowable(new UndefinedFunction(arg)); 2229 2229 } 2230 2230 public LispObject execute(LispObject first, LispObject second) … … 2238 2238 if (fun instanceof Function) 2239 2239 return funcall1(fun, second, LispThread.currentThread()); 2240 throw new ConditionThrowable(new UndefinedFunction Error(first));2240 throw new ConditionThrowable(new UndefinedFunction(first)); 2241 2241 } 2242 2242 public LispObject execute(LispObject first, LispObject second, … … 2251 2251 if (fun instanceof Function) 2252 2252 return funcall2(fun, second, third, LispThread.currentThread()); 2253 throw new ConditionThrowable(new UndefinedFunction Error(first));2253 throw new ConditionThrowable(new UndefinedFunction(first)); 2254 2254 } 2255 2255 public LispObject execute(LispObject[] args) throws ConditionThrowable … … 2273 2273 } 2274 2274 } 2275 throw new ConditionThrowable(new UndefinedFunction Error(args[0]));2275 throw new ConditionThrowable(new UndefinedFunction(args[0])); 2276 2276 } 2277 2277 }; … … 2345 2345 fun = fun.getSymbolFunction(); 2346 2346 if (!(fun instanceof Function)) 2347 throw new ConditionThrowable(new UndefinedFunction Error(first));2347 throw new ConditionThrowable(new UndefinedFunction(first)); 2348 2348 // Second argument must be a list. 2349 2349 LispObject list = checkList(second); … … 2373 2373 fun = fun.getSymbolFunction(); 2374 2374 if (!(fun instanceof Function)) 2375 throw new ConditionThrowable(new UndefinedFunction Error(first));2375 throw new ConditionThrowable(new UndefinedFunction(first)); 2376 2376 // Remaining arguments must be lists. 2377 2377 LispObject list1 = checkList(second); … … 2406 2406 fun = fun.getSymbolFunction(); 2407 2407 if (!(fun instanceof Function)) 2408 throw new ConditionThrowable(new UndefinedFunction Error(args[0]));2408 throw new ConditionThrowable(new UndefinedFunction(args[0])); 2409 2409 // Remaining arguments must be lists. 2410 2410 int commonLength = -1; … … 3344 3344 if (functional instanceof Function) 3345 3345 return functional; 3346 throw new ConditionThrowable(new UndefinedFunction Error(arg));3346 throw new ConditionThrowable(new UndefinedFunction(arg)); 3347 3347 } 3348 3348 if (arg instanceof Cons) { … … 3350 3350 return new Closure(arg.cadr(), arg.cddr(), env); 3351 3351 } 3352 throw new ConditionThrowable(new UndefinedFunction Error(String.valueOf(arg)));3352 throw new ConditionThrowable(new UndefinedFunction(String.valueOf(arg))); 3353 3353 } 3354 3354 }; … … 3522 3522 function = obj.getSymbolFunction(); 3523 3523 if (function == null) 3524 throw new ConditionThrowable(new UndefinedFunction Error(obj));3524 throw new ConditionThrowable(new UndefinedFunction(obj)); 3525 3525 } else if (obj instanceof Function) { 3526 3526 function = obj; … … 4464 4464 key = key.getSymbolFunction(); 4465 4465 if (!(key instanceof Function)) 4466 throw new ConditionThrowable(new UndefinedFunction Error(args[2]));4466 throw new ConditionThrowable(new UndefinedFunction(args[2])); 4467 4467 } 4468 4468 LispObject test = args[3]; … … 4476 4476 test = test.getSymbolFunction(); 4477 4477 if (!(test instanceof Function)) 4478 throw new ConditionThrowable(new UndefinedFunction Error(args[3]));4478 throw new ConditionThrowable(new UndefinedFunction(args[3])); 4479 4479 } else if (testNot != NIL) { 4480 4480 if (testNot instanceof Symbol) 4481 4481 testNot = testNot.getSymbolFunction(); 4482 4482 if (!(testNot instanceof Function)) 4483 throw new ConditionThrowable(new UndefinedFunction Error(args[3]));4483 throw new ConditionThrowable(new UndefinedFunction(args[3])); 4484 4484 } 4485 4485 if (key == NIL && test == EQL) { -
trunk/j/src/org/armedbear/lisp/ProgramError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: ProgramError.java,v 1. 7 2003-09-19 14:55:06piso Exp $5 * $Id: ProgramError.java,v 1.8 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 33 33 } 34 34 35 public LispObject typeOf() 36 { 37 return Symbol.PROGRAM_ERROR; 38 } 39 40 public LispClass classOf() 41 { 42 return LispClass.PROGRAM_ERROR; 43 } 44 35 45 public LispObject typep(LispObject type) throws ConditionThrowable 36 46 { -
trunk/j/src/org/armedbear/lisp/SimpleError.java
r3888 r3902 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: SimpleError.java,v 1. 2 2003-09-19 12:43:59piso Exp $5 * $Id: SimpleError.java,v 1.3 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 22 22 package org.armedbear.lisp; 23 23 24 public class SimpleError extends Condition24 public class SimpleError extends LispError 25 25 { 26 26 public SimpleError() … … 33 33 } 34 34 35 public LispObject typeOf() 36 { 37 return Symbol.SIMPLE_ERROR; 38 } 39 40 public LispClass classOf() 41 { 42 return LispClass.SIMPLE_ERROR; 43 } 44 35 45 public LispObject typep(LispObject type) throws ConditionThrowable 36 46 { 37 47 if (type == Symbol.SIMPLE_ERROR) 38 48 return T; 39 if (type == Symbol.ERROR)40 return T;41 49 return super.typep(type); 42 50 } -
trunk/j/src/org/armedbear/lisp/StreamError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: StreamError.java,v 1. 6 2003-09-19 14:55:06piso Exp $5 * $Id: StreamError.java,v 1.7 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 41 41 } 42 42 43 public LispObject typeOf() 44 { 45 return Symbol.STREAM_ERROR; 46 } 47 48 public LispClass classOf() 49 { 50 return LispClass.STREAM_ERROR; 51 } 52 43 53 public LispObject typep(LispObject type) throws ConditionThrowable 44 54 { -
trunk/j/src/org/armedbear/lisp/Symbol.java
r3894 r3902 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Symbol.java,v 1. 79 2003-09-19 14:44:10 piso Exp $5 * $Id: Symbol.java,v 1.80 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 318 318 { 319 319 if (function == null) 320 throw new ConditionThrowable(new UndefinedFunction Error(this));320 throw new ConditionThrowable(new UndefinedFunction(this)); 321 321 return function; 322 322 } -
trunk/j/src/org/armedbear/lisp/TypeError.java
r3895 r3902 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: TypeError.java,v 1. 5 2003-09-19 14:55:06piso Exp $5 * $Id: TypeError.java,v 1.6 2003-09-19 16:04:50 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 50 50 } 51 51 52 public LispObject typeOf() 53 { 54 return Symbol.TYPE_ERROR; 55 } 56 57 public LispClass classOf() 58 { 59 return LispClass.TYPE_ERROR; 60 } 61 52 62 public LispObject typep(LispObject type) throws ConditionThrowable 53 63 {
Note: See TracChangeset
for help on using the changeset viewer.