Changeset 3883
- Timestamp:
- 09/19/03 01:46:43 (20 years ago)
- Location:
- trunk/j/src/org/armedbear/lisp
- Files:
-
- 70 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/AbstractArray.java
r3848 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: AbstractArray.java,v 1. 8 2003-09-17 17:59:45piso Exp $5 * $Id: AbstractArray.java,v 1.9 2003-09-19 01:46:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 24 24 public abstract class AbstractArray extends LispObject 25 25 { 26 public LispObject typep(LispObject type) throws LispError26 public LispObject typep(LispObject type) throws ConditionThrowable 27 27 { 28 28 if (type == Symbol.ARRAY) … … 33 33 } 34 34 35 public boolean equalp(LispObject obj) throws LispError35 public boolean equalp(LispObject obj) throws ConditionThrowable 36 36 { 37 37 if (obj instanceof AbstractArray) { … … 52 52 } 53 53 54 public LispObject AREF(LispObject index) throws LispError54 public LispObject AREF(LispObject index) throws ConditionThrowable 55 55 { 56 56 StringBuffer sb = new StringBuffer("AREF: "); 57 57 sb.append("wrong number of subscripts (1) for array of rank "); 58 58 sb.append(getRank()); 59 throw new ProgramError(sb.toString());59 throw new ConditionThrowable(new ProgramError(sb.toString())); 60 60 } 61 61 … … 64 64 public abstract LispObject getDimensions(); 65 65 66 public abstract int getDimension(int n) throws LispError;66 public abstract int getDimension(int n) throws ConditionThrowable; 67 67 68 68 public abstract LispObject getElementType(); … … 70 70 public abstract int getTotalSize(); 71 71 72 public abstract LispObject getRowMajor(int index) throws LispError;72 public abstract LispObject getRowMajor(int index) throws ConditionThrowable; 73 73 74 public abstract void setRowMajor(int index, LispObject newValue) throws LispError;74 public abstract void setRowMajor(int index, LispObject newValue) throws ConditionThrowable; 75 75 } -
trunk/j/src/org/armedbear/lisp/AbstractVector.java
r3848 r3883 25 25 protected int fillPointer = -1; // -1 indicates no fill pointer. 26 26 27 public LispObject typep(LispObject type) throws LispError27 public LispObject typep(LispObject type) throws ConditionThrowable 28 28 { 29 29 if (type == Symbol.VECTOR) … … 47 47 } 48 48 49 public boolean equalp(LispObject obj) throws LispError49 public boolean equalp(LispObject obj) throws ConditionThrowable 50 50 { 51 51 if (obj instanceof AbstractVector) { … … 71 71 } 72 72 73 public final int getDimension(int n) throws LispError73 public final int getDimension(int n) throws ConditionThrowable 74 74 { 75 75 if (n != 0) … … 87 87 public abstract void ensureCapacity(int minCapacity); 88 88 89 public abstract LispObject get(int index) throws LispError;89 public abstract LispObject get(int index) throws ConditionThrowable; 90 90 91 public abstract void set(int index, LispObject newValue) throws LispError;91 public abstract void set(int index, LispObject newValue) throws ConditionThrowable; 92 92 93 public abstract LispObject subseq(int start, int end) throws LispError;93 public abstract LispObject subseq(int start, int end) throws ConditionThrowable; 94 94 95 public abstract void fill(LispObject obj) throws LispError;95 public abstract void fill(LispObject obj) throws ConditionThrowable; 96 96 97 public abstract void shrink(int n) throws LispError;97 public abstract void shrink(int n) throws ConditionThrowable; 98 98 99 public int checkIndex(int index) throws LispError99 public int checkIndex(int index) throws ConditionThrowable 100 100 { 101 101 if (index < 0 || index >= capacity()) … … 104 104 } 105 105 106 public int checkIndex(LispObject index) throws LispError106 public int checkIndex(LispObject index) throws ConditionThrowable 107 107 { 108 108 int i = Fixnum.getValue(index); … … 112 112 } 113 113 114 protected void badIndex(int index, int limit) throws LispError114 protected void badIndex(int index, int limit) throws ConditionThrowable 115 115 { 116 116 StringBuffer sb = new StringBuffer("invalid array index "); … … 136 136 } 137 137 138 public void setFillPointer(LispObject obj) throws LispError138 public void setFillPointer(LispObject obj) throws ConditionThrowable 139 139 { 140 140 if (obj == T) … … 165 165 } 166 166 167 public abstract LispObject reverse() throws LispError;167 public abstract LispObject reverse() throws ConditionThrowable; 168 168 169 public void nreverse() throws LispError169 public void nreverse() throws ConditionThrowable 170 170 { 171 171 int i = 0; -
trunk/j/src/org/armedbear/lisp/Array.java
r3848 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Array.java,v 1.1 1 2003-09-17 18:00:54piso Exp $5 * $Id: Array.java,v 1.12 2003-09-19 01:46:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 36 36 } 37 37 38 public Array(int[] dimv, LispObject initialContents) throws LispError38 public Array(int[] dimv, LispObject initialContents) throws ConditionThrowable 39 39 { 40 40 this.dimv = dimv; … … 50 50 } 51 51 52 public Array(int rank, LispObject initialContents) throws LispError52 public Array(int rank, LispObject initialContents) throws ConditionThrowable 53 53 { 54 54 if (rank == 0) { … … 73 73 private int setInitialContents(int axis, int[] dims, LispObject contents, 74 74 int index) 75 throws LispError75 throws ConditionThrowable 76 76 { 77 77 if (dims.length == 0) { … … 129 129 } 130 130 131 public LispObject typep(LispObject typeSpecifier) throws LispError131 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 132 132 { 133 133 if (typeSpecifier == Symbol.SIMPLE_ARRAY) … … 149 149 } 150 150 151 public int getDimension(int n) throws LispError151 public int getDimension(int n) throws ConditionThrowable 152 152 { 153 153 try { … … 169 169 } 170 170 171 public LispObject getRowMajor(int index) throws LispError171 public LispObject getRowMajor(int index) throws ConditionThrowable 172 172 { 173 173 try { … … 179 179 } 180 180 181 public void setRowMajor(int index, LispObject newValue) throws LispError181 public void setRowMajor(int index, LispObject newValue) throws ConditionThrowable 182 182 { 183 183 try { -
trunk/j/src/org/armedbear/lisp/Autoload.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Autoload.java,v 1.6 7 2003-09-19 00:05:09 piso Exp $5 * $Id: Autoload.java,v 1.68 2003-09-19 01:46:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 54 54 pkg.export(symbol); 55 55 } 56 catch ( LispError e) {56 catch (ConditionThrowable t) { 57 57 Debug.assertTrue(false); 58 58 } … … 118 118 new Primitive("autoload", PACKAGE_SYS, true) 119 119 { 120 public LispObject execute(LispObject first) throws LispError120 public LispObject execute(LispObject first) throws ConditionThrowable 121 121 { 122 122 if (first instanceof Symbol) { … … 135 135 } 136 136 public LispObject execute(LispObject first, LispObject second) 137 throws LispError137 throws ConditionThrowable 138 138 { 139 139 final String fileName = LispString.getValue(second); -
trunk/j/src/org/armedbear/lisp/AutoloadMacro.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: AutoloadMacro.java,v 1. 2 2003-09-19 00:05:09 piso Exp $5 * $Id: AutoloadMacro.java,v 1.3 2003-09-19 01:46:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 52 52 new Primitive("autoload-macro", PACKAGE_SYS, true) 53 53 { 54 public LispObject execute(LispObject first) throws LispError54 public LispObject execute(LispObject first) throws ConditionThrowable 55 55 { 56 56 if (first instanceof Symbol) { … … 69 69 } 70 70 public LispObject execute(LispObject first, LispObject second) 71 throws LispError71 throws ConditionThrowable 72 72 { 73 73 final String fileName = LispString.getValue(second); -
trunk/j/src/org/armedbear/lisp/Bignum.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Bignum.java,v 1.4 2 2003-09-19 00:05:09 piso Exp $5 * $Id: Bignum.java,v 1.43 2003-09-19 01:46:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 48 48 } 49 49 50 public LispObject typep(LispObject type) throws LispError50 public LispObject typep(LispObject type) throws ConditionThrowable 51 51 { 52 52 if (type == Symbol.BIGNUM) … … 122 122 } 123 123 124 public boolean equalp(LispObject obj) throws LispError124 public boolean equalp(LispObject obj) throws ConditionThrowable 125 125 { 126 126 if (obj instanceof Bignum) … … 182 182 } 183 183 184 public static BigInteger getValue(LispObject obj) throws LispError184 public static BigInteger getValue(LispObject obj) throws ConditionThrowable 185 185 { 186 186 try { … … 207 207 } 208 208 209 public LispObject add(LispObject obj) throws LispError209 public LispObject add(LispObject obj) throws ConditionThrowable 210 210 { 211 211 if (obj instanceof Fixnum) … … 228 228 } 229 229 230 public LispObject subtract(LispObject obj) throws LispError230 public LispObject subtract(LispObject obj) throws ConditionThrowable 231 231 { 232 232 if (obj instanceof Fixnum) … … 250 250 } 251 251 252 public LispObject multiplyBy(LispObject obj) throws LispError252 public LispObject multiplyBy(LispObject obj) throws ConditionThrowable 253 253 { 254 254 if (obj instanceof Fixnum) { … … 271 271 } 272 272 273 public LispObject divideBy(LispObject obj) throws LispError273 public LispObject divideBy(LispObject obj) throws ConditionThrowable 274 274 { 275 275 if (obj instanceof Fixnum) … … 286 286 } 287 287 288 public boolean isEqualTo(LispObject obj) throws LispError288 public boolean isEqualTo(LispObject obj) throws ConditionThrowable 289 289 { 290 290 if (obj instanceof Bignum) … … 297 297 } 298 298 299 public boolean isNotEqualTo(LispObject obj) throws LispError299 public boolean isNotEqualTo(LispObject obj) throws ConditionThrowable 300 300 { 301 301 if (obj instanceof Bignum) … … 308 308 } 309 309 310 public boolean isLessThan(LispObject obj) throws LispError310 public boolean isLessThan(LispObject obj) throws ConditionThrowable 311 311 { 312 312 if (obj instanceof Fixnum) … … 323 323 } 324 324 325 public boolean isGreaterThan(LispObject obj) throws LispError325 public boolean isGreaterThan(LispObject obj) throws ConditionThrowable 326 326 { 327 327 if (obj instanceof Fixnum) … … 338 338 } 339 339 340 public boolean isLessThanOrEqualTo(LispObject obj) throws LispError340 public boolean isLessThanOrEqualTo(LispObject obj) throws ConditionThrowable 341 341 { 342 342 if (obj instanceof Fixnum) … … 353 353 } 354 354 355 public boolean isGreaterThanOrEqualTo(LispObject obj) throws LispError355 public boolean isGreaterThanOrEqualTo(LispObject obj) throws ConditionThrowable 356 356 { 357 357 if (obj instanceof Fixnum) -
trunk/j/src/org/armedbear/lisp/BinaryInputStream.java
r1597 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: BinaryInputStream.java,v 1. 1 2003-04-09 18:08:29 piso Exp $5 * $Id: BinaryInputStream.java,v 1.2 2003-09-19 01:46:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 37 37 // read-byte stream &optional eof-error-p eof-value => byte 38 38 public LispObject readByte(boolean eofError, LispObject eofValue) 39 throws LispError39 throws ConditionThrowable 40 40 { 41 41 int n; -
trunk/j/src/org/armedbear/lisp/BitVector.java
r3781 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: BitVector.java,v 1.2 2 2003-09-14 17:36:11piso Exp $5 * $Id: BitVector.java,v 1.23 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 29 29 private long[] bits; 30 30 31 public BitVector(int length) throws LispError31 public BitVector(int length) throws ConditionThrowable 32 32 { 33 33 if (length < 0) … … 40 40 } 41 41 42 public BitVector(String s) throws LispError42 public BitVector(String s) throws ConditionThrowable 43 43 { 44 44 this(s.length()); … … 61 61 } 62 62 63 public LispObject typep(LispObject typeSpecifier) throws LispError63 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 64 64 { 65 65 if (typeSpecifier == Symbol.BIT_VECTOR) … … 119 119 } 120 120 121 public LispObject elt(int index) throws LispError121 public LispObject elt(int index) throws ConditionThrowable 122 122 { 123 123 if (index < 0 || index >= length()) … … 128 128 129 129 // Ignores fill pointer. 130 public LispObject AREF(LispObject index) throws LispError130 public LispObject AREF(LispObject index) throws ConditionThrowable 131 131 { 132 132 return get(Fixnum.getValue(index)); 133 133 } 134 134 135 public LispObject reverse() throws LispError135 public LispObject reverse() throws ConditionThrowable 136 136 { 137 137 int length = length(); … … 147 147 } 148 148 149 public LispObject getRowMajor(int index) throws LispError149 public LispObject getRowMajor(int index) throws ConditionThrowable 150 150 { 151 151 return get(index); 152 152 } 153 153 154 public void setRowMajor(int index, LispObject newValue) throws LispError154 public void setRowMajor(int index, LispObject newValue) throws ConditionThrowable 155 155 { 156 156 set(index, newValue); 157 157 } 158 158 159 public LispObject get(int index) throws LispError159 public LispObject get(int index) throws ConditionThrowable 160 160 { 161 161 if (index >= capacity) … … 171 171 } 172 172 173 public void set(int index, LispObject newValue) throws LispError173 public void set(int index, LispObject newValue) throws ConditionThrowable 174 174 { 175 175 if (index >= capacity) … … 203 203 } 204 204 205 public LispObject subseq(int start, int end) throws LispError205 public LispObject subseq(int start, int end) throws ConditionThrowable 206 206 { 207 207 BitVector v = new BitVector(end - start); … … 216 216 } 217 217 218 public void fill(LispObject obj) throws LispError218 public void fill(LispObject obj) throws ConditionThrowable 219 219 { 220 220 try { … … 236 236 } 237 237 238 public void shrink(int n) throws LispError238 public void shrink(int n) throws ConditionThrowable 239 239 { 240 240 if (n < capacity) { … … 260 260 } 261 261 262 public boolean equal(LispObject obj) throws LispError262 public boolean equal(LispObject obj) throws ConditionThrowable 263 263 { 264 264 if (this == obj) … … 277 277 } 278 278 279 public boolean equalp(LispObject obj) throws LispError279 public boolean equalp(LispObject obj) throws ConditionThrowable 280 280 { 281 281 if (this == obj) -
trunk/j/src/org/armedbear/lisp/CharacterFunctions.java
r2615 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: CharacterFunctions.java,v 1. 2 2003-06-26 02:36:14piso Exp $5 * $Id: CharacterFunctions.java,v 1.3 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 27 27 private static final Primitive CHAR_EQUALS = new Primitive("char=") { 28 28 public LispObject execute(LispObject first, LispObject second) 29 throws LispError29 throws ConditionThrowable 30 30 { 31 31 return LispCharacter.getValue(first) == LispCharacter.getValue(second) ? T : NIL; 32 32 } 33 public LispObject execute(LispObject[] array) throws LispError33 public LispObject execute(LispObject[] array) throws ConditionThrowable 34 34 { 35 35 final int length = array.length; 36 36 if (length == 0) 37 throw new WrongNumberOfArgumentsException(this);37 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 38 38 if (length > 1) { 39 39 final char c0 = LispCharacter.getValue(array[0]); … … 50 50 private static final Primitive CHAR_EQUAL = new Primitive("char-equal") { 51 51 public LispObject execute(LispObject first, LispObject second) 52 throws LispError52 throws ConditionThrowable 53 53 { 54 54 char c1 = LispCharacter.getValue(first); … … 62 62 return NIL; 63 63 } 64 public LispObject execute(LispObject[] array) throws LispError64 public LispObject execute(LispObject[] array) throws ConditionThrowable 65 65 { 66 66 final int length = array.length; 67 67 if (length == 0) 68 throw new WrongNumberOfArgumentsException(this);68 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 69 69 if (length > 1) { 70 70 final char c0 = LispCharacter.getValue(array[0]); … … 88 88 new Primitive("char-greaterp") { 89 89 public LispObject execute(LispObject first, LispObject second) 90 throws LispError90 throws ConditionThrowable 91 91 { 92 92 char c1 = Character.toUpperCase(LispCharacter.getValue(first)); … … 94 94 return c1 > c2 ? T : NIL; 95 95 } 96 public LispObject execute(LispObject[] array) throws LispError96 public LispObject execute(LispObject[] array) throws ConditionThrowable 97 97 { 98 98 final int length = array.length; 99 99 if (length == 0) 100 throw new WrongNumberOfArgumentsException(this);100 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 101 101 if (length > 1) { 102 102 char[] chars = new char[length]; … … 116 116 new Primitive("char-not-greaterp") { 117 117 public LispObject execute(LispObject first, LispObject second) 118 throws LispError118 throws ConditionThrowable 119 119 { 120 120 char c1 = Character.toUpperCase(LispCharacter.getValue(first)); … … 122 122 return c1 <= c2 ? T : NIL; 123 123 } 124 public LispObject execute(LispObject[] array) throws LispError124 public LispObject execute(LispObject[] array) throws ConditionThrowable 125 125 { 126 126 final int length = array.length; 127 127 if (length == 0) 128 throw new WrongNumberOfArgumentsException(this);128 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 129 129 if (length > 1) { 130 130 char[] chars = new char[length]; … … 144 144 new Primitive("char-lessp") { 145 145 public LispObject execute(LispObject first, LispObject second) 146 throws LispError146 throws ConditionThrowable 147 147 { 148 148 char c1 = Character.toUpperCase(LispCharacter.getValue(first)); … … 150 150 return c1 < c2 ? T : NIL; 151 151 } 152 public LispObject execute(LispObject[] array) throws LispError152 public LispObject execute(LispObject[] array) throws ConditionThrowable 153 153 { 154 154 final int length = array.length; 155 155 if (length == 0) 156 throw new WrongNumberOfArgumentsException(this);156 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 157 157 if (length > 1) { 158 158 char[] chars = new char[length]; … … 172 172 new Primitive("char-not-lessp") { 173 173 public LispObject execute(LispObject first, LispObject second) 174 throws LispError174 throws ConditionThrowable 175 175 { 176 176 char c1 = Character.toUpperCase(LispCharacter.getValue(first)); … … 178 178 return c1 >= c2 ? T : NIL; 179 179 } 180 public LispObject execute(LispObject[] array) throws LispError180 public LispObject execute(LispObject[] array) throws ConditionThrowable 181 181 { 182 182 final int length = array.length; 183 183 if (length == 0) 184 throw new WrongNumberOfArgumentsException(this);184 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 185 185 if (length > 1) { 186 186 char[] chars = new char[length]; -
trunk/j/src/org/armedbear/lisp/CharacterInputStream.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: CharacterInputStream.java,v 1.4 6 2003-09-19 00:05:09piso Exp $5 * $Id: CharacterInputStream.java,v 1.47 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 137 137 } 138 138 139 private LispString readString() throws LispError139 private LispString readString() throws ConditionThrowable 140 140 { 141 141 try { … … 233 233 } 234 234 235 private LispObject readRightParen() throws LispError235 private LispObject readRightParen() throws ConditionThrowable 236 236 { 237 237 throw new LispError("unmatched right parenthesis"); 238 238 } 239 239 240 private LispObject readComment() throws LispError240 private LispObject readComment() throws ConditionThrowable 241 241 { 242 242 try { … … 414 414 } 415 415 416 private Symbol readUninternedSymbol() throws LispError416 private Symbol readUninternedSymbol() throws ConditionThrowable 417 417 { 418 418 try { … … 482 482 } 483 483 484 private LispObject readBitVector() throws LispError484 private LispObject readBitVector() throws ConditionThrowable 485 485 { 486 486 try { … … 569 569 } 570 570 571 private LispObject readToken(char firstChar) throws LispError571 private LispObject readToken(char firstChar) throws ConditionThrowable 572 572 { 573 573 try { … … 596 596 } 597 597 598 private LispObject makeObject(String token) throws LispError598 private LispObject makeObject(String token) throws ConditionThrowable 599 599 { 600 600 final LispThread thread = LispThread.currentThread(); … … 647 647 } 648 648 649 private LispObject makeNumber(String token) throws LispError649 private LispObject makeNumber(String token) throws ConditionThrowable 650 650 { 651 651 if (token.indexOf('/') >= 0) … … 675 675 } 676 676 677 private LispObject makeRatio(String token) throws LispError677 private LispObject makeRatio(String token) throws ConditionThrowable 678 678 { 679 679 final int index = token.indexOf('/'); … … 689 689 } 690 690 691 private LispObject makeFloat(String token) throws LispError691 private LispObject makeFloat(String token) throws ConditionThrowable 692 692 { 693 693 final int length = token.length(); … … 732 732 } 733 733 734 private LispObject readBinary() throws LispError734 private LispObject readBinary() throws ConditionThrowable 735 735 { 736 736 try { … … 766 766 } 767 767 768 private LispObject readHex() throws LispError768 private LispObject readHex() throws ConditionThrowable 769 769 { 770 770 try { … … 804 804 } 805 805 806 private char flushWhitespace() throws LispError806 private char flushWhitespace() throws ConditionThrowable 807 807 { 808 808 try { … … 825 825 // recursive-p is ignored 826 826 public LispObject readLine(boolean eofError, LispObject eofValue) 827 throws LispError827 throws ConditionThrowable 828 828 { 829 829 StringBuffer sb = new StringBuffer(); … … 864 864 // recursive-p is ignored 865 865 public LispObject readChar(boolean eofError, LispObject eofValue) 866 throws LispError866 throws ConditionThrowable 867 867 { 868 868 int n; … … 883 883 884 884 // unread-char character &optional input-stream => nil 885 public LispObject unreadChar(LispCharacter c) throws LispError885 public LispObject unreadChar(LispCharacter c) throws ConditionThrowable 886 886 { 887 887 try { … … 895 895 896 896 // clear-input &optional input-stream => nil 897 public LispObject clearInput() throws LispError897 public LispObject clearInput() throws ConditionThrowable 898 898 { 899 899 try { -
trunk/j/src/org/armedbear/lisp/Closure.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Closure.java,v 1.5 4 2003-09-19 00:05:09piso Exp $5 * $Id: Closure.java,v 1.55 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 57 57 58 58 public Closure(LispObject lambdaList, LispObject body, Environment env) 59 throws LispError59 throws ConditionThrowable 60 60 { 61 61 this(null, lambdaList, body, env); … … 64 64 public Closure(String name, LispObject lambdaList, LispObject body, 65 65 Environment env) 66 throws LispError66 throws ConditionThrowable 67 67 { 68 68 super(name, getCurrentPackage()); … … 260 260 261 261 private static final void invalidParameter(LispObject obj) 262 throws LispError262 throws ConditionThrowable 263 263 { 264 264 throw new LispError(String.valueOf(obj) + … … 266 266 } 267 267 268 public LispObject typep(LispObject typeSpecifier) throws LispError268 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 269 269 { 270 270 if (typeSpecifier == Symbol.COMPILED_FUNCTION) … … 455 455 // Fixed arity. 456 456 if (args.length != arity) 457 throw new WrongNumberOfArgumentsException(this);457 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 458 458 return args; 459 459 } 460 460 // Not fixed arity. 461 461 if (args.length < minArgs) 462 throw new WrongNumberOfArgumentsException(this);462 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 463 463 Environment oldDynEnv = thread.getDynamicEnvironment(); 464 464 Environment ext = new Environment(environment); … … 529 529 } else { 530 530 if ((argsLeft % 2) != 0) 531 throw new ProgramError("odd number of keyword arguments");531 throw new ConditionThrowable(new ProgramError("odd number of keyword arguments")); 532 532 LispObject[] valueArray = new LispObject[keywordParameters.length]; 533 533 boolean[] boundpArray = new boolean[keywordParameters.length]; … … 567 567 if (!allowOtherKeys && 568 568 (allowOtherKeysValue == null || allowOtherKeysValue == NIL)) 569 throw new ProgramError("unrecognized keyword argument " +570 unrecognizedKeyword);569 throw new ConditionThrowable(new ProgramError("unrecognized keyword argument " + 570 unrecognizedKeyword)); 571 571 } 572 572 for (int n = 0; n < keywordParameters.length; n++) { … … 599 599 if (argsUsed < args.length) { 600 600 if (restVar == null) { 601 throw new WrongNumberOfArgumentsException(this);601 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 602 602 } 603 603 } … … 663 663 } 664 664 } 665 catch ( LispError e) {666 Debug.trace( e);665 catch (ConditionThrowable t) { 666 Debug.trace(t); 667 667 } 668 668 sb.append('>'); … … 699 699 public Parameter(Symbol var, LispObject initForm, LispObject svar, 700 700 int type) 701 throws LispError701 throws ConditionThrowable 702 702 { 703 703 this.var = var; … … 711 711 public Parameter(Symbol keyword, Symbol var, LispObject initForm, 712 712 LispObject svar) 713 throws LispError713 throws ConditionThrowable 714 714 { 715 715 this.var = var; -
trunk/j/src/org/armedbear/lisp/CompiledFunction.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: CompiledFunction.java,v 1.1 0 2003-09-19 00:05:09piso Exp $5 * $Id: CompiledFunction.java,v 1.11 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 26 26 public CompiledFunction(String name, LispObject lambdaList, 27 27 LispObject body, Environment env) 28 throws LispError28 throws ConditionThrowable 29 29 { 30 30 super(name, lambdaList, body, env); 31 31 } 32 32 33 public LispObject typep(LispObject typeSpecifier) throws LispError33 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 34 34 { 35 35 if (typeSpecifier == Symbol.COMPILED_FUNCTION) … … 84 84 public LispObject execute(LispObject first, LispObject second, 85 85 LispObject third) 86 throws LispError86 throws ConditionThrowable 87 87 { 88 88 String name; … … 101 101 private static final Primitive1 LOAD_COMPILED_FUNCTION = 102 102 new Primitive1("load-compiled-function", PACKAGE_SYS, false) { 103 public LispObject execute(LispObject arg) throws LispError103 public LispObject execute(LispObject arg) throws ConditionThrowable 104 104 { 105 105 String className = ((LispString)arg).getValue(); … … 132 132 private static final Primitive1 VARLIST = 133 133 new Primitive1("varlist", PACKAGE_SYS, false) { 134 public LispObject execute(LispObject arg) throws LispError{134 public LispObject execute(LispObject arg) throws ConditionThrowable { 135 135 if (arg instanceof CompiledFunction) 136 136 return ((CompiledFunction)arg).getVariableList(); -
trunk/j/src/org/armedbear/lisp/Complex.java
r3842 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Complex.java,v 1.2 1 2003-09-17 15:01:59piso Exp $5 * $Id: Complex.java,v 1.22 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 72 72 } 73 73 74 public LispObject typep(LispObject typeSpecifier) throws LispError74 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 75 75 { 76 76 if (typeSpecifier == Symbol.COMPLEX) … … 111 111 } 112 112 113 public boolean equalp(LispObject obj) throws LispError113 public boolean equalp(LispObject obj) throws ConditionThrowable 114 114 { 115 115 return isEqualTo(obj); 116 116 } 117 117 118 public final LispObject incr() throws LispError118 public final LispObject incr() throws ConditionThrowable 119 119 { 120 120 return new Complex(realpart.add(Fixnum.ONE), imagpart); 121 121 } 122 122 123 public final LispObject decr() throws LispError123 public final LispObject decr() throws ConditionThrowable 124 124 { 125 125 return new Complex(realpart.subtract(Fixnum.ONE), imagpart); 126 126 } 127 127 128 public LispObject add(LispObject obj) throws LispError128 public LispObject add(LispObject obj) throws ConditionThrowable 129 129 { 130 130 if (obj instanceof Complex) { … … 135 135 } 136 136 137 public LispObject subtract(LispObject obj) throws LispError137 public LispObject subtract(LispObject obj) throws ConditionThrowable 138 138 { 139 139 if (obj instanceof Complex) { … … 144 144 } 145 145 146 public LispObject multiplyBy(LispObject obj) throws LispError146 public LispObject multiplyBy(LispObject obj) throws ConditionThrowable 147 147 { 148 148 if (obj instanceof Complex) { … … 163 163 } 164 164 165 public LispObject divideBy(LispObject obj) throws LispError165 public LispObject divideBy(LispObject obj) throws ConditionThrowable 166 166 { 167 167 if (obj instanceof Complex) { … … 182 182 } 183 183 184 public boolean isEqualTo(LispObject obj) throws LispError184 public boolean isEqualTo(LispObject obj) throws ConditionThrowable 185 185 { 186 186 if (obj instanceof Complex) { … … 204 204 } 205 205 206 public boolean isNotEqualTo(LispObject obj) throws LispError206 public boolean isNotEqualTo(LispObject obj) throws ConditionThrowable 207 207 { 208 208 return !isEqualTo(obj); -
trunk/j/src/org/armedbear/lisp/Condition.java
r3872 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Condition.java,v 1. 3 2003-09-19 00:17:03piso Exp $5 * $Id: Condition.java,v 1.4 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 34 34 } 35 35 36 public LispObject typep(LispObject type) throws LispError36 public LispObject typep(LispObject type) throws ConditionThrowable 37 37 { 38 38 if (type == Symbol.CONDITION) -
trunk/j/src/org/armedbear/lisp/Cons.java
r3841 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Cons.java,v 1.2 6 2003-09-17 14:59:50 piso Exp $5 * $Id: Cons.java,v 1.27 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 51 51 } 52 52 53 public LispObject typep(LispObject typeSpecifier) throws LispError53 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 54 54 { 55 55 if (typeSpecifier == Symbol.LIST) … … 110 110 } 111 111 112 public final LispObject cadr() throws LispError112 public final LispObject cadr() throws ConditionThrowable 113 113 { 114 114 return cdr.car(); 115 115 } 116 116 117 public final LispObject cddr() throws LispError117 public final LispObject cddr() throws ConditionThrowable 118 118 { 119 119 return cdr.cdr(); 120 120 } 121 121 122 public final boolean equal(LispObject obj) throws LispError122 public final boolean equal(LispObject obj) throws ConditionThrowable 123 123 { 124 124 if (this == obj) … … 131 131 } 132 132 133 public final boolean equalp(LispObject obj) throws LispError133 public final boolean equalp(LispObject obj) throws ConditionThrowable 134 134 { 135 135 if (this == obj) … … 142 142 } 143 143 144 public final int length() throws LispError144 public final int length() throws ConditionThrowable 145 145 { 146 146 int length = 0; … … 158 158 } 159 159 160 public LispObject elt(int index) throws LispError160 public LispObject elt(int index) throws ConditionThrowable 161 161 { 162 162 if (index < 0) { … … 198 198 } 199 199 200 public LispObject remove(LispObject item) throws LispError200 public LispObject remove(LispObject item) throws ConditionThrowable 201 201 { 202 202 LispObject result = NIL; … … 218 218 } 219 219 220 public final LispObject[] copyToArray() throws LispError220 public final LispObject[] copyToArray() throws ConditionThrowable 221 221 { 222 222 final int length = length(); -
trunk/j/src/org/armedbear/lisp/DisplacedArray.java
r3848 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: DisplacedArray.java,v 1.1 0 2003-09-17 18:01:17piso Exp $5 * $Id: DisplacedArray.java,v 1.11 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 57 57 } 58 58 59 public LispObject typep(LispObject type) throws LispError59 public LispObject typep(LispObject type) throws ConditionThrowable 60 60 { 61 61 if (type == Symbol.VECTOR || type == LispClass.VECTOR) … … 87 87 } 88 88 89 public int length() throws LispError89 public int length() throws ConditionThrowable 90 90 { 91 91 if (dimv.length == 1) … … 94 94 } 95 95 96 public LispObject elt(int index) throws LispError96 public LispObject elt(int index) throws ConditionThrowable 97 97 { 98 98 if (dimv.length == 1) … … 101 101 } 102 102 103 public LispObject AREF(LispObject index) throws LispError103 public LispObject AREF(LispObject index) throws ConditionThrowable 104 104 { 105 105 if (dimv.length == 1) … … 108 108 sb.append("wrong number of subscripts (1) for array of rank "); 109 109 sb.append(getRank()); 110 throw new ProgramError(sb.toString());110 throw new ConditionThrowable(new ProgramError(sb.toString())); 111 111 } 112 112 … … 124 124 } 125 125 126 public int getDimension(int n) throws LispError126 public int getDimension(int n) throws ConditionThrowable 127 127 { 128 128 try { … … 144 144 } 145 145 146 public LispObject getRowMajor(int index) throws LispError146 public LispObject getRowMajor(int index) throws ConditionThrowable 147 147 { 148 148 if (index >= 0 && index < size) … … 151 151 } 152 152 153 public void setRowMajor(int index, LispObject newValue) throws LispError153 public void setRowMajor(int index, LispObject newValue) throws ConditionThrowable 154 154 { 155 155 if (index >= 0 && index < size) … … 162 162 private static final Primitive1 ARRAY_DISPLACEMENT = 163 163 new Primitive1("array-displacement") { 164 public LispObject execute(LispObject arg) throws LispError164 public LispObject execute(LispObject arg) throws ConditionThrowable 165 165 { 166 166 AbstractArray array = checkArray(arg); -
trunk/j/src/org/armedbear/lisp/Environment.java
r2512 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Environment.java,v 1. 5 2003-06-21 18:49:13piso Exp $5 * $Id: Environment.java,v 1.6 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 85 85 } 86 86 87 public LispObject lookupFunctional(LispObject symbol) throws LispError87 public LispObject lookupFunctional(LispObject symbol) throws ConditionThrowable 88 88 { 89 89 Binding binding = lastFunctionalBinding; -
trunk/j/src/org/armedbear/lisp/Extensions.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Extensions.java,v 1. 8 2003-09-19 00:05:09piso Exp $5 * $Id: Extensions.java,v 1.9 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 51 51 new Primitive2("make-socket", PACKAGE_EXT, true) { 52 52 public LispObject execute(LispObject first, LispObject second) 53 throws LispError53 throws ConditionThrowable 54 54 { 55 55 String host = LispString.getValue(first); -
trunk/j/src/org/armedbear/lisp/FillPointerOutputStream.java
r3316 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: FillPointerOutputStream.java,v 1. 1 2003-08-10 17:46:39piso Exp $5 * $Id: FillPointerOutputStream.java,v 1.2 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 36 36 private static final Primitive1 MAKE_FILL_POINTER_OUTPUT_STREAM = 37 37 new Primitive1("make-fill-pointer-output-stream", PACKAGE_SYS, false) { 38 public LispObject execute(LispObject arg) throws LispError38 public LispObject execute(LispObject arg) throws ConditionThrowable 39 39 { 40 40 LispString string = checkString(arg); -
trunk/j/src/org/armedbear/lisp/Fixnum.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Fixnum.java,v 1. 69 2003-09-19 00:05:09piso Exp $5 * $Id: Fixnum.java,v 1.70 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 52 52 } 53 53 54 public LispObject typep(LispObject type) throws LispError54 public LispObject typep(LispObject type) throws ConditionThrowable 55 55 { 56 56 if (type == Symbol.FIXNUM) … … 179 179 } 180 180 181 public static int getValue(LispObject obj) throws LispError181 public static int getValue(LispObject obj) throws ConditionThrowable 182 182 { 183 183 try { … … 189 189 } 190 190 191 public static int getInt(LispObject obj) throws LispError191 public static int getInt(LispObject obj) throws ConditionThrowable 192 192 { 193 193 try { … … 199 199 } 200 200 201 public static BigInteger getBigInteger(LispObject obj) throws LispError201 public static BigInteger getBigInteger(LispObject obj) throws ConditionThrowable 202 202 { 203 203 try { … … 209 209 } 210 210 211 public static float getFloat(LispObject obj) throws LispError211 public static float getFloat(LispObject obj) throws ConditionThrowable 212 212 { 213 213 try { … … 243 243 } 244 244 245 public LispObject add(LispObject obj) throws LispError245 public LispObject add(LispObject obj) throws ConditionThrowable 246 246 { 247 247 if (obj instanceof Fixnum) … … 265 265 } 266 266 267 public LispObject subtract(LispObject obj) throws LispError267 public LispObject subtract(LispObject obj) throws ConditionThrowable 268 268 { 269 269 if (obj instanceof Fixnum) … … 288 288 } 289 289 290 public LispObject multiplyBy(LispObject obj) throws LispError290 public LispObject multiplyBy(LispObject obj) throws ConditionThrowable 291 291 { 292 292 if (obj instanceof Fixnum) … … 311 311 } 312 312 313 public LispObject divideBy(LispObject obj) throws LispError313 public LispObject divideBy(LispObject obj) throws ConditionThrowable 314 314 { 315 315 try { … … 349 349 } 350 350 351 public boolean isEqualTo(LispObject obj) throws LispError351 public boolean isEqualTo(LispObject obj) throws ConditionThrowable 352 352 { 353 353 if (obj instanceof Fixnum) … … 362 362 } 363 363 364 public boolean isNotEqualTo(LispObject obj) throws LispError364 public boolean isNotEqualTo(LispObject obj) throws ConditionThrowable 365 365 { 366 366 if (obj instanceof Fixnum) … … 376 376 } 377 377 378 public boolean isLessThan(LispObject obj) throws LispError378 public boolean isLessThan(LispObject obj) throws ConditionThrowable 379 379 { 380 380 if (obj instanceof Fixnum) … … 392 392 } 393 393 394 public boolean isGreaterThan(LispObject obj) throws LispError394 public boolean isGreaterThan(LispObject obj) throws ConditionThrowable 395 395 { 396 396 if (obj instanceof Fixnum) … … 408 408 } 409 409 410 public boolean isLessThanOrEqualTo(LispObject obj) throws LispError410 public boolean isLessThanOrEqualTo(LispObject obj) throws ConditionThrowable 411 411 { 412 412 if (obj instanceof Fixnum) … … 424 424 } 425 425 426 public boolean isGreaterThanOrEqualTo(LispObject obj) throws LispError426 public boolean isGreaterThanOrEqualTo(LispObject obj) throws ConditionThrowable 427 427 { 428 428 if (obj instanceof Fixnum) -
trunk/j/src/org/armedbear/lisp/Function.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Function.java,v 1.2 2 2003-09-19 00:05:10 piso Exp $5 * $Id: Function.java,v 1.23 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 74 74 pkg.export(symbol); 75 75 } 76 catch ( LispError e) {76 catch (ConditionThrowable t) { 77 77 Debug.assertTrue(false); 78 78 } … … 82 82 symbol.setFunctionDocumentation(docstring); 83 83 } 84 catch ( LispError e) {84 catch (ConditionThrowable t) { 85 85 Debug.assertTrue(false); 86 86 } … … 107 107 } 108 108 109 public LispObject typep(LispObject typeSpecifier) throws LispError109 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 110 110 { 111 111 if (typeSpecifier == Symbol.FUNCTION) … … 138 138 if (module != null) 139 139 return module.dispatch(args, index); 140 throw new WrongNumberOfArgumentsException(name);140 throw new ConditionThrowable(new WrongNumberOfArgumentsException(name)); 141 141 } 142 142 -
trunk/j/src/org/armedbear/lisp/HashTable.java
r3845 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: HashTable.java,v 1.1 7 2003-09-17 15:12:41piso Exp $5 * $Id: HashTable.java,v 1.18 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 45 45 private HashTable(LispObject test, int size, LispObject rehashSize, 46 46 LispObject rehashThreshold) 47 throws LispError47 throws ConditionThrowable 48 48 { 49 49 if (test == NIL || test == Symbol.EQ.getSymbolFunction()) … … 72 72 } 73 73 74 public LispObject typep(LispObject typeSpecifier) throws LispError74 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 75 75 { 76 76 if (typeSpecifier == Symbol.HASH_TABLE) … … 84 84 public synchronized LispObject gethash(LispObject key, 85 85 LispObject defaultValue) 86 throws LispError86 throws ConditionThrowable 87 87 { 88 88 LispObject[] values = new LispObject[2]; … … 99 99 100 100 public synchronized LispObject puthash(LispObject key, LispObject newValue) 101 throws LispError101 throws ConditionThrowable 102 102 { 103 103 put(key, newValue); … … 106 106 107 107 // remhash key hash-table => generalized-boolean 108 public synchronized LispObject remhash(LispObject key) throws LispError108 public synchronized LispObject remhash(LispObject key) throws ConditionThrowable 109 109 { 110 110 // A value in a Lisp hash table can never be null, so... … … 140 140 } 141 141 142 public LispObject get(LispObject key) throws LispError142 public LispObject get(LispObject key) throws ConditionThrowable 143 143 { 144 144 int idx = hash(key); … … 152 152 } 153 153 154 public LispObject put(LispObject key, LispObject value) throws LispError154 public LispObject put(LispObject key, LispObject value) throws ConditionThrowable 155 155 { 156 156 int idx = hash(key); … … 176 176 } 177 177 178 public LispObject remove(LispObject key) throws LispError178 public LispObject remove(LispObject key) throws ConditionThrowable 179 179 { 180 180 int idx = hash(key); … … 201 201 } 202 202 203 private final boolean equals(LispObject o1, LispObject o2) throws LispError203 private final boolean equals(LispObject o1, LispObject o2) throws ConditionThrowable 204 204 { 205 205 switch (test) { … … 277 277 private static final Primitive _MAKE_HASH_TABLE = 278 278 new Primitive("%make-hash-table", PACKAGE_SYS, false) { 279 public LispObject execute(LispObject[] args) throws LispError279 public LispObject execute(LispObject[] args) throws ConditionThrowable 280 280 { 281 281 if (args.length != 4) 282 throw new WrongNumberOfArgumentsException(this);282 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 283 283 LispObject test = args[0]; 284 284 int size = Fixnum.getValue(args[1]); … … 292 292 // gethash key hash-table &optional default => value, present-p 293 293 private static final Primitive GETHASH = new Primitive("gethash") { 294 public LispObject execute(LispObject[] args) throws LispError294 public LispObject execute(LispObject[] args) throws ConditionThrowable 295 295 { 296 296 final int length = args.length; 297 297 if (length < 2 || length > 3) 298 throw new WrongNumberOfArgumentsException(this);298 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 299 299 if (args[1] instanceof HashTable) { 300 300 LispObject key = args[0]; … … 312 312 private static final Primitive PUTHASH = 313 313 new Primitive("puthash", PACKAGE_SYS, false) { 314 public LispObject execute(LispObject[] args) throws LispError314 public LispObject execute(LispObject[] args) throws ConditionThrowable 315 315 { 316 316 final int length = args.length; 317 317 if (length < 3 || length > 4) 318 throw new WrongNumberOfArgumentsException(this);318 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 319 319 if (args[1] instanceof HashTable) { 320 320 LispObject key = args[0]; … … 336 336 private static final Primitive2 REMHASH = new Primitive2("remhash") { 337 337 public LispObject execute(LispObject first, LispObject second) 338 throws LispError338 throws ConditionThrowable 339 339 { 340 340 if (second instanceof HashTable) { … … 350 350 // sxhash object => hash-code 351 351 private static final Primitive1 SXHASH = new Primitive1("sxhash") { 352 public LispObject execute(LispObject arg) throws LispError352 public LispObject execute(LispObject arg) throws ConditionThrowable 353 353 { 354 354 return new Fixnum(arg.hashCode()); … … 359 359 private static final Primitive1 HASH_TABLE_P = 360 360 new Primitive1("hash-table-p") { 361 public LispObject execute(LispObject arg) throws LispError361 public LispObject execute(LispObject arg) throws ConditionThrowable 362 362 { 363 363 return arg instanceof HashTable ? T : NIL; … … 368 368 private static final Primitive1 HASH_TABLE_ENTRIES = 369 369 new Primitive1("hash-table-entries", PACKAGE_SYS, false) { 370 public LispObject execute(LispObject arg) throws LispError370 public LispObject execute(LispObject arg) throws ConditionThrowable 371 371 { 372 372 if (arg instanceof HashTable) -
trunk/j/src/org/armedbear/lisp/Interpreter.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Interpreter.java,v 1.3 1 2003-09-19 00:05:10 piso Exp $5 * $Id: Interpreter.java,v 1.32 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 232 232 // character. 233 233 private char peekCharNonWhitespace(CharacterInputStream stream) 234 throws LispError234 throws ConditionThrowable 235 235 { 236 236 while (true) { … … 245 245 } 246 246 247 private static Object getHistory(String s) throws LispError247 private static Object getHistory(String s) throws ConditionThrowable 248 248 { 249 249 s = s.trim(); -
trunk/j/src/org/armedbear/lisp/Java.java
r1528 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Java.java,v 1. 7 2003-04-03 18:36:08piso Exp $5 * $Id: Java.java,v 1.8 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 32 32 private static final Primitive1 JCLASS = 33 33 new Primitive1("jclass", PACKAGE_JAVA) { 34 public LispObject execute(LispObject arg) throws LispError34 public LispObject execute(LispObject arg) throws ConditionThrowable 35 35 { 36 36 try { … … 50 50 private static final Primitive JCONSTRUCTOR = 51 51 new Primitive("jconstructor", PACKAGE_JAVA) { 52 public LispObject execute(LispObject[] args) throws LispError52 public LispObject execute(LispObject[] args) throws ConditionThrowable 53 53 { 54 54 if (args.length < 1) 55 throw new WrongNumberOfArgumentsException(this);55 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 56 56 String className = LispString.getValue(args[0]); 57 57 try { … … 80 80 private static final Primitive JMETHOD = 81 81 new Primitive("jmethod", PACKAGE_JAVA) { 82 public LispObject execute(LispObject[] args) throws LispError82 public LispObject execute(LispObject[] args) throws ConditionThrowable 83 83 { 84 84 if (args.length < 2) 85 throw new WrongNumberOfArgumentsException(this);85 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 86 86 String className = LispString.getValue(args[0]); 87 87 String methodName = LispString.getValue(args[1]); … … 131 131 private static final Primitive JSTATIC = 132 132 new Primitive("jstatic", PACKAGE_JAVA) { 133 public LispObject execute(LispObject[] args) throws LispError133 public LispObject execute(LispObject[] args) throws ConditionThrowable 134 134 { 135 135 if (args.length < 2) 136 throw new WrongNumberOfArgumentsException(this);136 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 137 137 try { 138 138 Method m = null; … … 191 191 // jnew constructor &rest args 192 192 private static final Primitive JNEW = new Primitive("jnew", PACKAGE_JAVA) { 193 public LispObject execute(LispObject[] args) throws LispError193 public LispObject execute(LispObject[] args) throws ConditionThrowable 194 194 { 195 195 if (args.length < 1) 196 throw new WrongNumberOfArgumentsException(this);196 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 197 197 LispObject classRef = args[0]; 198 198 try { … … 217 217 // jcall method instance &rest args 218 218 private static final Primitive JCALL = new Primitive("jcall", PACKAGE_JAVA) { 219 public LispObject execute(LispObject[] args) throws LispError219 public LispObject execute(LispObject[] args) throws ConditionThrowable 220 220 { 221 221 if (args.length < 2) 222 throw new WrongNumberOfArgumentsException(this);222 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 223 223 try { 224 224 Method method = (Method) JavaObject.getObject(args[0]); … … 270 270 } 271 271 272 private static final LispObject makeLispObject(Object obj) throws LispError272 private static final LispObject makeLispObject(Object obj) throws ConditionThrowable 273 273 { 274 274 if (obj == null) -
trunk/j/src/org/armedbear/lisp/Lisp.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Lisp.java,v 1.13 3 2003-09-19 00:05:10 piso Exp $5 * $Id: Lisp.java,v 1.134 2003-09-19 01:46:40 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 50 50 PACKAGE_EXT.usePackage(PACKAGE_CL); 51 51 } 52 catch ( LispError e) {53 e.printStackTrace();52 catch (Throwable t) { 53 t.printStackTrace(); 54 54 } 55 55 } … … 348 348 return closure.execute(evalList(args, env, thread)); 349 349 } else 350 throw new ProgramError("illegal function object: " + first);350 throw new ConditionThrowable(new ProgramError("illegal function object: " + first)); 351 351 } 352 352 } else … … 452 452 } 453 453 454 public static Symbol checkSymbol(LispObject obj) throws LispError454 public static Symbol checkSymbol(LispObject obj) throws ConditionThrowable 455 455 { 456 456 if (obj == null) … … 464 464 } 465 465 466 public static final Cons checkCons(LispObject obj) throws LispError466 public static final Cons checkCons(LispObject obj) throws ConditionThrowable 467 467 { 468 468 if (obj == null) … … 477 477 478 478 public static final LispObject checkList(LispObject obj) 479 throws LispError479 throws ConditionThrowable 480 480 { 481 481 if (obj == null) … … 487 487 488 488 public static final AbstractArray checkArray(LispObject obj) 489 throws LispError489 throws ConditionThrowable 490 490 { 491 491 if (obj == null) … … 500 500 501 501 public static final AbstractVector checkVector(LispObject obj) 502 throws LispError502 throws ConditionThrowable 503 503 { 504 504 if (obj == null) … … 513 513 514 514 public static final LispString checkString(LispObject obj) 515 throws LispError515 throws ConditionThrowable 516 516 { 517 517 if (obj == null) … … 525 525 } 526 526 527 public static final LispString string(LispObject arg) throws LispError527 public static final LispString string(LispObject arg) throws ConditionThrowable 528 528 { 529 529 if (arg instanceof LispString) … … 537 537 } 538 538 539 public static final String javaString(LispObject arg) throws LispError539 public static final String javaString(LispObject arg) throws ConditionThrowable 540 540 { 541 541 if (arg instanceof LispString) … … 561 561 public static final LispObject number(BigInteger numerator, 562 562 BigInteger denominator) 563 throws LispError563 throws ConditionThrowable 564 564 { 565 565 if (denominator.signum() == 0) … … 647 647 648 648 public static final LispCharacter checkCharacter(LispObject obj) 649 throws LispError649 throws ConditionThrowable 650 650 { 651 651 if (obj == null) … … 660 660 661 661 public static final Package checkPackage(LispObject obj) 662 throws LispError662 throws ConditionThrowable 663 663 { 664 664 if (obj == null) … … 673 673 674 674 public static final Function checkFunction(LispObject obj) 675 throws LispError675 throws ConditionThrowable 676 676 { 677 677 if (obj == null) … … 686 686 687 687 public static final LispStream checkStream(LispObject obj) 688 throws LispError688 throws ConditionThrowable 689 689 { 690 690 if (obj == null) … … 699 699 700 700 public static final CharacterInputStream checkInputStream(LispObject obj) 701 throws LispError701 throws ConditionThrowable 702 702 { 703 703 if (obj == null) … … 711 711 712 712 public static final CharacterOutputStream checkOutputStream(LispObject obj) 713 throws LispError713 throws ConditionThrowable 714 714 { 715 715 if (obj == null) … … 723 723 724 724 public static final Readtable checkReadtable(LispObject obj) 725 throws LispError725 throws ConditionThrowable 726 726 { 727 727 if (obj == null) … … 736 736 737 737 public static final Environment checkEnvironment(LispObject obj) 738 throws LispError738 throws ConditionThrowable 739 739 { 740 740 if (obj == null) … … 749 749 750 750 public static final Function coerceToFunction(LispObject obj) 751 throws LispError751 throws ConditionThrowable 752 752 { 753 753 if (obj instanceof Function) … … 764 764 // Returns package or throws exception. 765 765 public static final Package coerceToPackage(LispObject obj) 766 throws LispError766 throws ConditionThrowable 767 767 { 768 768 if (obj instanceof Package) … … 777 777 public static final LispObject get(Symbol symbol, LispObject indicator, 778 778 LispObject defaultValue) 779 throws LispError779 throws ConditionThrowable 780 780 { 781 781 LispObject result = get(symbol, indicator); … … 785 785 // Returns null if there is no property with the specified indicator. 786 786 public static final LispObject get(Symbol symbol, LispObject indicator) 787 throws LispError787 throws ConditionThrowable 788 788 { 789 789 LispObject list = checkList(symbol.getPropertyList()); … … 799 799 public static final LispObject put(Symbol symbol, LispObject indicator, 800 800 LispObject value) 801 throws LispError801 throws ConditionThrowable 802 802 { 803 803 LispObject list = checkList(symbol.getPropertyList()); … … 825 825 // Used by jvm compiler. 826 826 public static final Symbol internInPackage(String name, String packageName) 827 throws LispError827 throws ConditionThrowable 828 828 { 829 829 Package pkg = Packages.findPackage(packageName); … … 839 839 pkg.export(symbol); // FIXME Inefficient! 840 840 } 841 catch ( LispError e) {842 Debug.trace( e);841 catch (ConditionThrowable t) { 842 Debug.trace(t); 843 843 } 844 844 return symbol; … … 861 861 pkg.export(symbol); // FIXME Inefficient! 862 862 } 863 catch ( LispError e) {864 Debug.trace( e);863 catch (ConditionThrowable t) { 864 Debug.trace(t); 865 865 } 866 866 symbol.setSpecial(true); … … 876 876 pkg.export(symbol); // FIXME Inefficient! 877 877 } 878 catch ( LispError e) {879 Debug.trace( e);878 catch (ConditionThrowable t) { 879 Debug.trace(t); 880 880 } 881 881 symbol.setConstant(true); … … 937 937 } 938 938 939 public static final CharacterOutputStream getStandardOutput() throws LispError939 public static final CharacterOutputStream getStandardOutput() throws ConditionThrowable 940 940 { 941 941 return checkOutputStream(_STANDARD_OUTPUT_.symbolValueNoThrow()); … … 975 975 public static final Primitive0 DEBUG = 976 976 new Primitive0("%debug", PACKAGE_SYS, false) { 977 public LispObject execute() throws LispError977 public LispObject execute() throws ConditionThrowable 978 978 { 979 979 debug = true; … … 984 984 public static final Primitive0 NODEBUG = 985 985 new Primitive0("%nodebug", PACKAGE_SYS, false) { 986 public LispObject execute() throws LispError986 public LispObject execute() throws ConditionThrowable 987 987 { 988 988 final LispThread thread = LispThread.currentThread(); … … 1000 1000 public static final Primitive0 START_PROFILER = 1001 1001 new Primitive0("start-profiler", PACKAGE_EXT, true) { 1002 public LispObject execute() throws LispError1002 public LispObject execute() throws ConditionThrowable 1003 1003 { 1004 1004 CharacterOutputStream out = getStandardOutput(); … … 1030 1030 public static final Primitive0 STOP_PROFILER = 1031 1031 new Primitive0("stop-profiler", PACKAGE_EXT, true) { 1032 public LispObject execute() throws LispError1032 public LispObject execute() throws ConditionThrowable 1033 1033 { 1034 1034 CharacterOutputStream out = getStandardOutput(); -
trunk/j/src/org/armedbear/lisp/LispCharacter.java
r3849 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: LispCharacter.java,v 1.2 4 2003-09-17 18:07:34piso Exp $5 * $Id: LispCharacter.java,v 1.25 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 58 58 } 59 59 60 public LispObject typep(LispObject type) throws LispError60 public LispObject typep(LispObject type) throws ConditionThrowable 61 61 { 62 62 if (type == Symbol.CHARACTER) … … 114 114 } 115 115 116 public static char getValue(LispObject obj) throws LispError116 public static char getValue(LispObject obj) throws ConditionThrowable 117 117 { 118 118 try { … … 169 169 170 170 private static final Primitive1 CHARACTER = new Primitive1("character") { 171 public LispObject execute(LispObject arg) throws LispError171 public LispObject execute(LispObject arg) throws ConditionThrowable 172 172 { 173 173 if (arg instanceof LispCharacter) … … 188 188 private static final Primitive1 WHITESPACEP = 189 189 new Primitive1("whitespacep", PACKAGE_SYS, false) { 190 public LispObject execute(LispObject arg) throws LispError190 public LispObject execute(LispObject arg) throws ConditionThrowable 191 191 { 192 192 LispCharacter character = checkCharacter(arg); -
trunk/j/src/org/armedbear/lisp/LispClass.java
r3874 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispClass.java,v 1.1 3 2003-09-19 00:18:19piso Exp $5 * $Id: LispClass.java,v 1.14 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 110 110 // ### find-class 111 111 private static final Primitive FIND_CLASS = new Primitive("find-class") { 112 public LispObject execute(LispObject[] args) throws LispError112 public LispObject execute(LispObject[] args) throws ConditionThrowable 113 113 { 114 114 if (args.length < 1) 115 throw new WrongNumberOfArgumentsException(this);115 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 116 116 LispObject obj = (LispObject) map.get(checkSymbol(args[0])); 117 117 return obj != null ? obj : NIL; … … 121 121 // ### class-name 122 122 private static final Primitive1 CLASS_NAME = new Primitive1("class-name") { 123 public LispObject execute(LispObject arg) throws LispError123 public LispObject execute(LispObject arg) throws ConditionThrowable 124 124 { 125 125 try { -
trunk/j/src/org/armedbear/lisp/LispFloat.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispFloat.java,v 1.4 4 2003-09-19 00:05:10piso Exp $5 * $Id: LispFloat.java,v 1.45 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 44 44 } 45 45 46 public LispObject typep(LispObject typeSpecifier) throws LispError46 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 47 47 { 48 48 if (typeSpecifier == Symbol.FLOAT) … … 102 102 } 103 103 104 public boolean equalp(LispObject obj) throws LispError104 public boolean equalp(LispObject obj) throws ConditionThrowable 105 105 { 106 106 if (obj instanceof LispFloat) … … 147 147 } 148 148 149 public static double getValue(LispObject obj) throws LispError149 public static double getValue(LispObject obj) throws ConditionThrowable 150 150 { 151 151 try { … … 172 172 } 173 173 174 public LispObject add(LispObject obj) throws LispError174 public LispObject add(LispObject obj) throws ConditionThrowable 175 175 { 176 176 if (obj instanceof LispFloat) … … 189 189 } 190 190 191 public LispObject subtract(LispObject obj) throws LispError191 public LispObject subtract(LispObject obj) throws ConditionThrowable 192 192 { 193 193 if (obj instanceof LispFloat) … … 207 207 } 208 208 209 public LispObject multiplyBy(LispObject obj) throws LispError209 public LispObject multiplyBy(LispObject obj) throws ConditionThrowable 210 210 { 211 211 if (obj instanceof LispFloat) … … 220 220 } 221 221 222 public LispObject divideBy(LispObject obj) throws LispError222 public LispObject divideBy(LispObject obj) throws ConditionThrowable 223 223 { 224 224 if (obj.zerop()) … … 235 235 } 236 236 237 public boolean isEqualTo(LispObject obj) throws LispError237 public boolean isEqualTo(LispObject obj) throws ConditionThrowable 238 238 { 239 239 if (obj instanceof LispFloat) … … 250 250 } 251 251 252 public boolean isNotEqualTo(LispObject obj) throws LispError252 public boolean isNotEqualTo(LispObject obj) throws ConditionThrowable 253 253 { 254 254 return !isEqualTo(obj); 255 255 } 256 256 257 public boolean isLessThan(LispObject obj) throws LispError257 public boolean isLessThan(LispObject obj) throws ConditionThrowable 258 258 { 259 259 if (obj instanceof LispFloat) … … 268 268 } 269 269 270 public boolean isGreaterThan(LispObject obj) throws LispError270 public boolean isGreaterThan(LispObject obj) throws ConditionThrowable 271 271 { 272 272 if (obj instanceof LispFloat) … … 281 281 } 282 282 283 public boolean isLessThanOrEqualTo(LispObject obj) throws LispError283 public boolean isLessThanOrEqualTo(LispObject obj) throws ConditionThrowable 284 284 { 285 285 if (obj instanceof LispFloat) … … 294 294 } 295 295 296 public boolean isGreaterThanOrEqualTo(LispObject obj) throws LispError296 public boolean isGreaterThanOrEqualTo(LispObject obj) throws ConditionThrowable 297 297 { 298 298 if (obj instanceof LispFloat) … … 374 374 private static final Primitive1 INTEGER_DECODE_FLOAT = 375 375 new Primitive1("integer-decode-float") { 376 public LispObject execute(LispObject arg) throws LispError376 public LispObject execute(LispObject arg) throws ConditionThrowable 377 377 { 378 378 if (arg instanceof LispFloat) { … … 404 404 private static final Primitive1 FLOAT_RADIX = 405 405 new Primitive1("float-radix") { 406 public LispObject execute(LispObject arg) throws LispError406 public LispObject execute(LispObject arg) throws ConditionThrowable 407 407 { 408 408 if (arg instanceof LispFloat) … … 416 416 private static final Primitive1 FLOAT_DIGITS = 417 417 new Primitive1("float-digits") { 418 public LispObject execute(LispObject arg) throws LispError418 public LispObject execute(LispObject arg) throws ConditionThrowable 419 419 { 420 420 if (arg instanceof LispFloat) … … 440 440 // float number &optional prototype => float 441 441 private static final Primitive FLOAT = new Primitive("float") { 442 public LispObject execute(LispObject[] args) throws LispError442 public LispObject execute(LispObject[] args) throws ConditionThrowable 443 443 { 444 444 final int length = args.length; 445 445 if (length < 1 || length > 2) 446 throw new WrongNumberOfArgumentsException(this);446 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 447 447 // FIXME Ignore prototype (args[1] if present). 448 448 return coerceToFloat(args[0]); … … 453 453 // floatp object => generalized-boolean 454 454 private static final Primitive1 FLOATP = new Primitive1("floatp") { 455 public LispObject execute(LispObject arg) throws LispError455 public LispObject execute(LispObject arg) throws ConditionThrowable 456 456 { 457 457 return arg.FLOATP(); -
trunk/j/src/org/armedbear/lisp/LispObject.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: LispObject.java,v 1.5 6 2003-09-19 00:05:10piso Exp $5 * $Id: LispObject.java,v 1.57 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 39 39 } 40 40 41 public LispObject typep(LispObject typeSpecifier) throws LispError41 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 42 42 { 43 43 if (typeSpecifier == T) … … 70 70 } 71 71 72 public LispObject car() throws LispError73 { 74 throw new TypeError(this, "list"); 75 } 76 77 public void setCar(LispObject obj) throws LispError72 public LispObject car() throws ConditionThrowable 73 { 74 throw new TypeError(this, "list"); 75 } 76 77 public void setCar(LispObject obj) throws ConditionThrowable 78 78 { 79 79 throw new TypeError(this, "cons"); 80 80 } 81 81 82 public LispObject cdr() throws LispError83 { 84 throw new TypeError(this, "list"); 85 } 86 87 public void setCdr(LispObject obj) throws LispError82 public LispObject cdr() throws ConditionThrowable 83 { 84 throw new TypeError(this, "list"); 85 } 86 87 public void setCdr(LispObject obj) throws ConditionThrowable 88 88 { 89 89 throw new TypeError(this, "cons"); 90 90 } 91 91 92 public LispObject cadr() throws LispError93 { 94 throw new TypeError(this, "list"); 95 } 96 97 public LispObject cddr() throws LispError92 public LispObject cadr() throws ConditionThrowable 93 { 94 throw new TypeError(this, "list"); 95 } 96 97 public LispObject cddr() throws ConditionThrowable 98 98 { 99 99 throw new TypeError(this, "list"); … … 115 115 } 116 116 117 public boolean equal(LispObject obj) throws LispError117 public boolean equal(LispObject obj) throws ConditionThrowable 118 118 { 119 119 return this == obj; 120 120 } 121 121 122 public boolean equalp(LispObject obj) throws LispError122 public boolean equalp(LispObject obj) throws ConditionThrowable 123 123 { 124 124 return this == obj; … … 270 270 } 271 271 272 public int length() throws LispError272 public int length() throws ConditionThrowable 273 273 { 274 274 throw new TypeError(this, "sequence"); 275 275 } 276 276 277 public final LispObject LENGTH() throws LispError277 public final LispObject LENGTH() throws ConditionThrowable 278 278 { 279 279 return new Fixnum(length()); 280 280 } 281 281 282 public LispObject elt(int index) throws LispError282 public LispObject elt(int index) throws ConditionThrowable 283 283 { 284 284 throw new TypeError(this, "sequence"); 285 285 } 286 286 287 public LispObject AREF(LispObject index) throws LispError287 public LispObject AREF(LispObject index) throws ConditionThrowable 288 288 { 289 289 throw new TypeError(this, "array"); 290 290 } 291 291 292 public LispObject[] copyToArray() throws LispError292 public LispObject[] copyToArray() throws ConditionThrowable 293 293 { 294 294 throw new TypeError(this, "list"); … … 325 325 } 326 326 327 public LispObject getSymbolValue() throws LispError327 public LispObject getSymbolValue() throws ConditionThrowable 328 328 { 329 329 throw new TypeError(this, "symbol"); 330 330 } 331 331 332 public LispObject getSymbolFunction() throws LispError332 public LispObject getSymbolFunction() throws ConditionThrowable 333 333 { 334 334 throw new TypeError(this, "symbol"); 335 335 } 336 336 337 public LispObject getSymbolFunctionOrDie() throws LispError337 public LispObject getSymbolFunctionOrDie() throws ConditionThrowable 338 338 { 339 339 throw new TypeError(this, "symbol"); … … 384 384 } 385 385 386 public LispObject incr() throws LispError387 { 388 throw new TypeError(this, "number"); 389 } 390 391 public LispObject decr() throws LispError392 { 393 throw new TypeError(this, "number"); 394 } 395 396 public LispObject add(LispObject obj) throws LispError397 { 398 throw new TypeError(this, "number"); 399 } 400 401 public LispObject subtract(LispObject obj) throws LispError402 { 403 throw new TypeError(this, "number"); 404 } 405 406 public LispObject multiplyBy(LispObject obj) throws LispError407 { 408 throw new TypeError(this, "number"); 409 } 410 411 public LispObject divideBy(LispObject obj) throws LispError412 { 413 throw new TypeError(this, "number"); 414 } 415 416 public boolean isEqualTo(LispObject obj) throws LispError417 { 418 throw new TypeError(this, "number"); 419 } 420 421 public LispObject IS_E(LispObject obj) throws LispError386 public LispObject incr() throws ConditionThrowable 387 { 388 throw new TypeError(this, "number"); 389 } 390 391 public LispObject decr() throws ConditionThrowable 392 { 393 throw new TypeError(this, "number"); 394 } 395 396 public LispObject add(LispObject obj) throws ConditionThrowable 397 { 398 throw new TypeError(this, "number"); 399 } 400 401 public LispObject subtract(LispObject obj) throws ConditionThrowable 402 { 403 throw new TypeError(this, "number"); 404 } 405 406 public LispObject multiplyBy(LispObject obj) throws ConditionThrowable 407 { 408 throw new TypeError(this, "number"); 409 } 410 411 public LispObject divideBy(LispObject obj) throws ConditionThrowable 412 { 413 throw new TypeError(this, "number"); 414 } 415 416 public boolean isEqualTo(LispObject obj) throws ConditionThrowable 417 { 418 throw new TypeError(this, "number"); 419 } 420 421 public LispObject IS_E(LispObject obj) throws ConditionThrowable 422 422 { 423 423 return isEqualTo(obj) ? T : NIL; 424 424 } 425 425 426 public boolean isNotEqualTo(LispObject obj) throws LispError427 { 428 throw new TypeError(this, "number"); 429 } 430 431 public LispObject IS_NE(LispObject obj) throws LispError426 public boolean isNotEqualTo(LispObject obj) throws ConditionThrowable 427 { 428 throw new TypeError(this, "number"); 429 } 430 431 public LispObject IS_NE(LispObject obj) throws ConditionThrowable 432 432 { 433 433 return isNotEqualTo(obj) ? T : NIL; 434 434 } 435 435 436 public boolean isLessThan(LispObject obj) throws LispError437 { 438 throw new TypeError(this, "number"); 439 } 440 441 public LispObject IS_LT(LispObject obj) throws LispError436 public boolean isLessThan(LispObject obj) throws ConditionThrowable 437 { 438 throw new TypeError(this, "number"); 439 } 440 441 public LispObject IS_LT(LispObject obj) throws ConditionThrowable 442 442 { 443 443 return isLessThan(obj) ? T : NIL; 444 444 } 445 445 446 public boolean isGreaterThan(LispObject obj) throws LispError447 { 448 throw new TypeError(this, "number"); 449 } 450 451 public LispObject IS_GT(LispObject obj) throws LispError446 public boolean isGreaterThan(LispObject obj) throws ConditionThrowable 447 { 448 throw new TypeError(this, "number"); 449 } 450 451 public LispObject IS_GT(LispObject obj) throws ConditionThrowable 452 452 { 453 453 return isGreaterThan(obj) ? T : NIL; 454 454 } 455 455 456 public boolean isLessThanOrEqualTo(LispObject obj) throws LispError457 { 458 throw new TypeError(this, "number"); 459 } 460 461 public LispObject IS_LE(LispObject obj) throws LispError456 public boolean isLessThanOrEqualTo(LispObject obj) throws ConditionThrowable 457 { 458 throw new TypeError(this, "number"); 459 } 460 461 public LispObject IS_LE(LispObject obj) throws ConditionThrowable 462 462 { 463 463 return isLessThanOrEqualTo(obj) ? T : NIL; 464 464 } 465 465 466 public boolean isGreaterThanOrEqualTo(LispObject obj) throws LispError467 { 468 throw new TypeError(this, "number"); 469 } 470 471 public LispObject IS_GE(LispObject obj) throws LispError466 public boolean isGreaterThanOrEqualTo(LispObject obj) throws ConditionThrowable 467 { 468 throw new TypeError(this, "number"); 469 } 470 471 public LispObject IS_GE(LispObject obj) throws ConditionThrowable 472 472 { 473 473 return isGreaterThanOrEqualTo(obj) ? T : NIL; -
trunk/j/src/org/armedbear/lisp/LispStream.java
r1751 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: LispStream.java,v 1. 3 2003-05-10 14:57:25piso Exp $5 * $Id: LispStream.java,v 1.4 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 24 24 public abstract class LispStream extends LispObject 25 25 { 26 public LispObject typep(LispObject typeSpecifier) throws LispError26 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 27 27 { 28 28 if (typeSpecifier == Symbol.STREAM) -
trunk/j/src/org/armedbear/lisp/LispString.java
r3832 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: LispString.java,v 1.5 7 2003-09-16 19:01:08piso Exp $5 * $Id: LispString.java,v 1.58 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 64 64 } 65 65 66 public LispObject typep(LispObject typeSpecifier) throws LispError66 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 67 67 { 68 68 if (typeSpecifier instanceof Symbol) { … … 114 114 } 115 115 116 public boolean equalp(LispObject obj) throws LispError116 public boolean equalp(LispObject obj) throws ConditionThrowable 117 117 { 118 118 if (this == obj) … … 135 135 } 136 136 137 public LispObject subseq(int start, int end) throws LispError137 public LispObject subseq(int start, int end) throws ConditionThrowable 138 138 { 139 139 LispString s = new LispString(end - start); … … 144 144 } 145 145 146 public void fill(LispObject obj) throws LispError146 public void fill(LispObject obj) throws ConditionThrowable 147 147 { 148 148 fill(LispCharacter.getValue(obj)); … … 155 155 } 156 156 157 public void shrink(int n) throws LispError157 public void shrink(int n) throws ConditionThrowable 158 158 { 159 159 if (n < array.length) { … … 168 168 } 169 169 170 public LispObject reverse() throws LispError170 public LispObject reverse() throws ConditionThrowable 171 171 { 172 172 int length = length(); … … 178 178 } 179 179 180 public void nreverse() throws LispError180 public void nreverse() throws ConditionThrowable 181 181 { 182 182 int i = 0; … … 191 191 } 192 192 193 public LispObject getRowMajor(int index) throws LispError193 public LispObject getRowMajor(int index) throws ConditionThrowable 194 194 { 195 195 try { … … 202 202 } 203 203 204 public void setRowMajor(int index, LispObject newValue) throws LispError204 public void setRowMajor(int index, LispObject newValue) throws ConditionThrowable 205 205 { 206 206 try { … … 212 212 } 213 213 214 public LispObject get(int index) throws LispError214 public LispObject get(int index) throws ConditionThrowable 215 215 { 216 216 try { … … 223 223 } 224 224 225 public void set(int index, LispObject newValue) throws LispError225 public void set(int index, LispObject newValue) throws ConditionThrowable 226 226 { 227 227 try { … … 238 238 } 239 239 240 public static String getValue(LispObject obj) throws LispError240 public static String getValue(LispObject obj) throws ConditionThrowable 241 241 { 242 242 try { … … 272 272 } 273 273 274 public LispObject elt(int index) throws LispError274 public LispObject elt(int index) throws ConditionThrowable 275 275 { 276 276 int limit = fillPointer >= 0 ? fillPointer : array.length; … … 281 281 282 282 // Ignores fill pointer. 283 public LispObject AREF(LispObject index) throws LispError283 public LispObject AREF(LispObject index) throws ConditionThrowable 284 284 { 285 285 try { … … 292 292 } 293 293 294 public LispObject remove(LispObject item) throws LispError294 public LispObject remove(LispObject item) throws ConditionThrowable 295 295 { 296 296 throw new LispError("not implemented"); … … 334 334 new Primitive3("%make-string", PACKAGE_SYS, false) { 335 335 public LispObject execute(LispObject size, LispObject initialElement, 336 LispObject elementType) throws LispError336 LispObject elementType) throws ConditionThrowable 337 337 { 338 338 final int n = Fixnum.getValue(size); … … 365 365 private static final Primitive2 CHAR = new Primitive2("char") { 366 366 public LispObject execute(LispObject first, LispObject second) 367 throws LispError367 throws ConditionThrowable 368 368 { 369 369 return checkString(first).get(Fixnum.getInt(second)); … … 374 374 new Primitive3("%set-char", PACKAGE_SYS, false) { 375 375 public LispObject execute(LispObject first, LispObject second, 376 LispObject third) throws LispError376 LispObject third) throws ConditionThrowable 377 377 { 378 378 checkString(first).set(Fixnum.getInt(second), checkCharacter(third)); … … 383 383 private static final Primitive2 SCHAR = new Primitive2("schar") { 384 384 public LispObject execute(LispObject first, LispObject second) 385 throws LispError385 throws ConditionThrowable 386 386 { 387 387 return checkString(first).get(Fixnum.getInt(second)); … … 392 392 new Primitive3("%set-schar", PACKAGE_SYS, false) { 393 393 public LispObject execute(LispObject first, LispObject second, 394 LispObject third) throws LispError394 LispObject third) throws ConditionThrowable 395 395 { 396 396 checkString(first).set(Fixnum.getInt(second), checkCharacter(third)); … … 403 403 public LispObject execute(LispObject first, LispObject second, 404 404 LispObject third) 405 throws LispError405 throws ConditionThrowable 406 406 { 407 407 char c = LispCharacter.getValue(first); -
trunk/j/src/org/armedbear/lisp/LispThread.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispThread.java,v 1.1 0 2003-09-19 00:05:10piso Exp $5 * $Id: LispThread.java,v 1.11 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 216 216 } 217 217 218 public void checkStack() throws LispError218 public void checkStack() throws ConditionThrowable 219 219 { 220 220 if (stack.size() > 0) { … … 301 301 stream.print(')'); 302 302 } 303 catch ( LispError e) {304 Debug.trace( e);303 catch (ConditionThrowable t) { 304 Debug.trace(t); 305 305 } 306 306 } else { … … 326 326 private static final Primitive1 MAKE_THREAD = 327 327 new Primitive1("make-thread", PACKAGE_EXT, true) { 328 public LispObject execute(LispObject arg) throws LispError328 public LispObject execute(LispObject arg) throws ConditionThrowable 329 329 { 330 330 Function fun = checkFunction(arg); … … 335 335 // ### sleep 336 336 private static final Primitive1 SLEEP = new Primitive1("sleep") { 337 public LispObject execute(LispObject arg) throws LispError337 public LispObject execute(LispObject arg) throws ConditionThrowable 338 338 { 339 339 double d = -
trunk/j/src/org/armedbear/lisp/Load.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Load.java,v 1.1 7 2003-09-19 00:05:10piso Exp $5 * $Id: Load.java,v 1.18 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 279 279 { 280 280 if (args.length == 0) 281 throw new WrongNumberOfArgumentsException(this);281 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 282 282 // For now we require a string, but we should also support streams 283 283 // and pathnames. -
trunk/j/src/org/armedbear/lisp/Module.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Module.java,v 1. 4 2003-09-19 00:05:10piso Exp $5 * $Id: Module.java,v 1.5 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 44 44 45 45 public LispObject dispatch(LispObject first, LispObject second, int index) 46 throws LispError46 throws ConditionThrowable 47 47 { 48 48 throw new LispError(); -
trunk/j/src/org/armedbear/lisp/Nil.java
r3788 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Nil.java,v 1.2 2 2003-09-15 04:16:07piso Exp $5 * $Id: Nil.java,v 1.23 2003-09-19 01:46:41 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 35 35 } 36 36 37 public LispObject typep(LispObject typeSpecifier) throws LispError37 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 38 38 { 39 39 if (typeSpecifier == Symbol.NULL) … … 85 85 } 86 86 87 public LispObject elt(int index) throws LispError87 public LispObject elt(int index) throws ConditionThrowable 88 88 { 89 89 throw new TypeError("ELT: invalid index " + index + " for " + this); … … 120 120 } 121 121 122 public LispObject remove(LispObject item) throws LispError122 public LispObject remove(LispObject item) throws ConditionThrowable 123 123 { 124 124 return NIL; -
trunk/j/src/org/armedbear/lisp/Package.java
r3841 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Package.java,v 1.4 3 2003-09-17 14:56:53piso Exp $5 * $Id: Package.java,v 1.44 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 58 58 } 59 59 60 public LispObject typep(LispObject typeSpecifier) throws LispError60 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 61 61 { 62 62 if (typeSpecifier == Symbol.PACKAGE) … … 89 89 90 90 public final synchronized void rename(String newName, LispObject newNicks) 91 throws LispError91 throws ConditionThrowable 92 92 { 93 93 ArrayList arrayList = null; … … 334 334 } 335 335 336 public synchronized void importSymbol(Symbol symbol) throws LispError336 public synchronized void importSymbol(Symbol symbol) throws ConditionThrowable 337 337 { 338 338 if (symbol.getPackage() == this) … … 349 349 } 350 350 351 public synchronized void export(Symbol symbol) throws LispError351 public synchronized void export(Symbol symbol) throws ConditionThrowable 352 352 { 353 353 final String symbolName = symbol.getName(); … … 407 407 } 408 408 409 public synchronized void unexport(Symbol symbol) throws LispError409 public synchronized void unexport(Symbol symbol) throws ConditionThrowable 410 410 { 411 411 final String symbolName = symbol.getName(); … … 430 430 } 431 431 432 public synchronized void shadow(String symbolName) throws LispError432 public synchronized void shadow(String symbolName) throws ConditionThrowable 433 433 { 434 434 Symbol symbol = (Symbol) externalSymbols.get(symbolName); … … 449 449 } 450 450 451 public synchronized void shadowingImport(Symbol symbol) throws LispError451 public synchronized void shadowingImport(Symbol symbol) throws ConditionThrowable 452 452 { 453 453 LispObject where = NIL; … … 512 512 } 513 513 514 public final void addNickname(String s) throws LispError514 public final void addNickname(String s) throws ConditionThrowable 515 515 { 516 516 // This call will throw an error if there's a naming conflict. -
trunk/j/src/org/armedbear/lisp/PackageFunctions.java
r2880 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: PackageFunctions.java,v 1.1 6 2003-07-08 01:52:06piso Exp $5 * $Id: PackageFunctions.java,v 1.17 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 27 27 // packagep object => generalized-boolean 28 28 private static final Primitive1 PACKAGEP = new Primitive1("packagep") { 29 public LispObject execute(LispObject arg) throws LispError29 public LispObject execute(LispObject arg) throws ConditionThrowable 30 30 { 31 31 return arg instanceof Package ? T : NIL; … … 37 37 private static final Primitive1 PACKAGE_NAME = 38 38 new Primitive1("package-name") { 39 public LispObject execute(LispObject arg) throws LispError39 public LispObject execute(LispObject arg) throws ConditionThrowable 40 40 { 41 41 String name = coerceToPackage(arg).getName(); … … 48 48 private static final Primitive1 PACKAGE_NICKNAMES = 49 49 new Primitive1("package-nicknames") { 50 public LispObject execute(LispObject arg) throws LispError50 public LispObject execute(LispObject arg) throws ConditionThrowable 51 51 { 52 52 return coerceToPackage(arg).packageNicknames(); … … 58 58 private static final Primitive1 PACKAGE_USE_LIST = 59 59 new Primitive1("package-use-list") { 60 public LispObject execute(LispObject arg) throws LispError60 public LispObject execute(LispObject arg) throws ConditionThrowable 61 61 { 62 62 return coerceToPackage(arg).getUseList(); … … 68 68 private static final Primitive1 PACKAGE_USED_BY_LIST = 69 69 new Primitive1("package-used-by-list") { 70 public LispObject execute(LispObject arg) throws LispError70 public LispObject execute(LispObject arg) throws ConditionThrowable 71 71 { 72 72 return coerceToPackage(arg).getUsedByList(); … … 77 77 // import symbols &optional package => t 78 78 private static final Primitive IMPORT = new Primitive("import") { 79 public LispObject execute(LispObject[] args) throws LispError79 public LispObject execute(LispObject[] args) throws ConditionThrowable 80 80 { 81 81 if (args.length == 0 || args.length > 2) 82 throw new WrongNumberOfArgumentsException(this);82 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 83 83 LispObject symbols = args[0]; 84 84 Package pkg = … … 98 98 // unexport symbols &optional package => t 99 99 private static final Primitive UNEXPORT = new Primitive("unexport") { 100 public LispObject execute(LispObject[] args) throws LispError100 public LispObject execute(LispObject[] args) throws ConditionThrowable 101 101 { 102 102 if (args.length == 0 || args.length > 2) 103 throw new WrongNumberOfArgumentsException(this);103 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 104 104 LispObject symbols = args[0]; 105 105 Package pkg = … … 119 119 // shadow symbol-names &optional package => t 120 120 private static final Primitive SHADOW = new Primitive("shadow") { 121 public LispObject execute(LispObject[] args) throws LispError121 public LispObject execute(LispObject[] args) throws ConditionThrowable 122 122 { 123 123 if (args.length == 0 || args.length > 2) 124 throw new WrongNumberOfArgumentsException(this);124 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 125 125 LispObject symbols = args[0]; 126 126 Package pkg = … … 141 141 private static final Primitive SHADOWING_IMPORT = 142 142 new Primitive("shadowing-import") { 143 public LispObject execute(LispObject[] args) throws LispError143 public LispObject execute(LispObject[] args) throws ConditionThrowable 144 144 { 145 145 if (args.length == 0 || args.length > 2) 146 throw new WrongNumberOfArgumentsException(this);146 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 147 147 LispObject symbols = args[0]; 148 148 Package pkg = … … 163 163 private static final Primitive1 PACKAGE_SHADOWING_SYMBOLS = 164 164 new Primitive1("package-shadowing-symbols") { 165 public LispObject execute(LispObject arg) throws LispError165 public LispObject execute(LispObject arg) throws ConditionThrowable 166 166 { 167 167 return coerceToPackage(arg).getShadowingSymbols(); … … 172 172 private static final Primitive1 DELETE_PACKAGE = 173 173 new Primitive1("delete-package") { 174 public LispObject execute(LispObject arg) throws LispError174 public LispObject execute(LispObject arg) throws ConditionThrowable 175 175 { 176 176 return coerceToPackage(arg).delete() ? T : NIL; … … 182 182 private static final Primitive USE_PACKAGE = 183 183 new Primitive("unuse-package") { 184 public LispObject execute(LispObject[] args) throws LispError184 public LispObject execute(LispObject[] args) throws ConditionThrowable 185 185 { 186 186 if (args.length < 1 || args.length > 2) 187 throw new WrongNumberOfArgumentsException(this);187 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 188 188 Package pkg; 189 189 if (args.length == 2) … … 207 207 private static final Primitive RENAME_PACKAGE = 208 208 new Primitive("rename-package") { 209 public LispObject execute(LispObject[] args) throws LispError209 public LispObject execute(LispObject[] args) throws ConditionThrowable 210 210 { 211 211 if (args.length < 2 || args.length > 3) 212 throw new WrongNumberOfArgumentsException(this);212 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 213 213 Package pkg = coerceToPackage(args[0]); 214 214 String newName = javaString(args[1]); … … 232 232 private static final Primitive _DEFPACKAGE = 233 233 new Primitive("%defpackage", PACKAGE_SYS, false) { 234 public LispObject execute(LispObject[] args) throws LispError234 public LispObject execute(LispObject[] args) throws ConditionThrowable 235 235 { 236 236 if (args.length != 10) 237 throw new WrongNumberOfArgumentsException(this);237 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 238 238 final String packageName = LispString.getValue(args[0]); 239 239 LispObject nicknames = checkList(args[1]); -
trunk/j/src/org/armedbear/lisp/Packages.java
r2875 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Packages.java,v 1. 8 2003-07-07 19:37:39piso Exp $5 * $Id: Packages.java,v 1.9 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 50 50 51 51 public static final synchronized void addPackage(Package pkg) 52 throws LispError52 throws ConditionThrowable 53 53 { 54 54 final String name = pkg.getName(); … … 74 74 75 75 public static final synchronized Package makePackage(String name) 76 throws LispError76 throws ConditionThrowable 77 77 { 78 78 if (map.get(name) != null) … … 87 87 public static final synchronized void addNickname(Package pkg, 88 88 String nickname) 89 throws LispError89 throws ConditionThrowable 90 90 { 91 91 if (map.get(nickname) != null) -
trunk/j/src/org/armedbear/lisp/Pathname.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Pathname.java,v 1.1 1 2003-09-19 00:05:11piso Exp $5 * $Id: Pathname.java,v 1.12 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 53 53 } 54 54 55 public LispObject typep(LispObject typeSpecifier) throws LispError55 public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable 56 56 { 57 57 if (typeSpecifier == Symbol.PATHNAME) … … 149 149 { 150 150 if (args.length != 8) 151 throw new WrongNumberOfArgumentsException(this);151 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 152 152 LispObject host = args[0]; 153 153 LispObject device = args[1]; -
trunk/j/src/org/armedbear/lisp/Primitive0.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitive0.java,v 1. 7 2003-09-19 00:05:11piso Exp $5 * $Id: Primitive0.java,v 1.8 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 56 56 public LispObject execute(LispObject first) throws ConditionThrowable 57 57 { 58 throw new WrongNumberOfArgumentsException(this);58 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 59 59 } 60 60 … … 62 62 throws ConditionThrowable 63 63 { 64 throw new WrongNumberOfArgumentsException(this);64 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 65 65 } 66 66 … … 68 68 LispObject third) throws ConditionThrowable 69 69 { 70 throw new WrongNumberOfArgumentsException(this);70 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 71 71 } 72 72 … … 74 74 { 75 75 if (args.length != 0) 76 throw new WrongNumberOfArgumentsException(this);76 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 77 77 return execute(); 78 78 } -
trunk/j/src/org/armedbear/lisp/Primitive1.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitive1.java,v 1. 7 2003-09-19 00:05:11piso Exp $5 * $Id: Primitive1.java,v 1.8 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 56 56 public LispObject execute() throws ConditionThrowable 57 57 { 58 throw new WrongNumberOfArgumentsException(this);58 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 59 59 } 60 60 … … 62 62 throws ConditionThrowable 63 63 { 64 throw new WrongNumberOfArgumentsException(this);64 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 65 65 } 66 66 … … 68 68 LispObject third) throws ConditionThrowable 69 69 { 70 throw new WrongNumberOfArgumentsException(this);70 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 71 71 } 72 72 … … 74 74 { 75 75 if (args.length != 1) 76 throw new WrongNumberOfArgumentsException(this);76 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 77 77 return execute(args[0]); 78 78 } -
trunk/j/src/org/armedbear/lisp/Primitive2.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitive2.java,v 1. 6 2003-09-19 00:05:11piso Exp $5 * $Id: Primitive2.java,v 1.7 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 50 50 public LispObject execute() throws ConditionThrowable 51 51 { 52 throw new WrongNumberOfArgumentsException(this);52 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 53 53 } 54 54 … … 56 56 throws ConditionThrowable 57 57 { 58 throw new WrongNumberOfArgumentsException(this);58 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 59 59 } 60 60 … … 62 62 LispObject third) throws ConditionThrowable 63 63 { 64 throw new WrongNumberOfArgumentsException(this);64 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 65 65 } 66 66 … … 68 68 { 69 69 if (args.length != 2) 70 throw new WrongNumberOfArgumentsException(this);70 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 71 71 return execute(args[0], args[1]); 72 72 } -
trunk/j/src/org/armedbear/lisp/Primitive3.java
r3871 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitive3.java,v 1. 7 2003-09-19 00:05:11piso Exp $5 * $Id: Primitive3.java,v 1.8 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 50 50 public LispObject execute() throws ConditionThrowable 51 51 { 52 throw new WrongNumberOfArgumentsException(this);52 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 53 53 } 54 54 … … 56 56 throws ConditionThrowable 57 57 { 58 throw new WrongNumberOfArgumentsException(this);58 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 59 59 } 60 60 … … 62 62 throws ConditionThrowable 63 63 { 64 throw new WrongNumberOfArgumentsException(this);64 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 65 65 } 66 66 … … 68 68 { 69 69 if (args.length != 3) 70 throw new WrongNumberOfArgumentsException(this);70 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 71 71 return execute(args[0], args[1], args[2]); 72 72 } -
trunk/j/src/org/armedbear/lisp/Primitives.java
r3881 r3883 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.40 4 2003-09-19 01:08:41piso Exp $5 * $Id: Primitives.java,v 1.405 2003-09-19 01:46:42 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 189 189 // Primitive 190 190 public LispObject dispatch(LispObject[] args, int index) 191 throws LispError191 throws ConditionThrowable 192 192 { 193 193 switch (index) { … … 200 200 case DIVIDE: { // ### / 201 201 if (args.length < 1) 202 throw new WrongNumberOfArgumentsException("/");202 throw new ConditionThrowable(new WrongNumberOfArgumentsException("/")); 203 203 if (args.length == 1) 204 204 return Fixnum.ONE.divideBy(args[0]); … … 210 210 case MIN: { // ### min 211 211 if (args.length < 1) 212 throw new WrongNumberOfArgumentsException("MIN");212 throw new ConditionThrowable(new WrongNumberOfArgumentsException("MIN")); 213 213 LispObject result = args[0]; 214 214 if (!result.realp()) … … 222 222 case MAX: { // ### max 223 223 if (args.length < 1) 224 throw new WrongNumberOfArgumentsException("MAX");224 throw new ConditionThrowable(new WrongNumberOfArgumentsException("MAX")); 225 225 LispObject result = args[0]; 226 226 if (!result.realp()) … … 239 239 default: 240 240 Debug.trace("bad index " + index); 241 throw new WrongNumberOfArgumentsException((String)null);241 throw new ConditionThrowable(new WrongNumberOfArgumentsException((String)null)); 242 242 } 243 243 } … … 375 375 default: 376 376 Debug.trace("bad index " + index); 377 throw new WrongNumberOfArgumentsException((String)null);377 throw new ConditionThrowable(new WrongNumberOfArgumentsException((String)null)); 378 378 } 379 379 } … … 381 381 // Primitive2 382 382 public LispObject dispatch(LispObject first, LispObject second, int index) 383 throws LispError383 throws ConditionThrowable 384 384 { 385 385 switch (index) { … … 406 406 default: 407 407 Debug.trace("bad index " + index); 408 throw new WrongNumberOfArgumentsException((String)null);408 throw new ConditionThrowable(new WrongNumberOfArgumentsException((String)null)); 409 409 } 410 410 } … … 413 413 private static final Primitive2 EQ = new Primitive2("eq") { 414 414 public LispObject execute(LispObject first, LispObject second) 415 throws LispError415 throws ConditionThrowable 416 416 { 417 417 return first == second ? T : NIL; … … 422 422 private static final Primitive2 EQL = new Primitive2("eql") { 423 423 public LispObject execute(LispObject first, LispObject second) 424 throws LispError424 throws ConditionThrowable 425 425 { 426 426 return first.eql(second) ? T : NIL; … … 431 431 private static final Primitive2 EQUAL = new Primitive2("equal") { 432 432 public LispObject execute(LispObject first, LispObject second) 433 throws LispError433 throws ConditionThrowable 434 434 { 435 435 return first.equal(second) ? T : NIL; … … 440 440 private static final Primitive2 EQUALP = new Primitive2("equalp") { 441 441 public LispObject execute(LispObject first, LispObject second) 442 throws LispError442 throws ConditionThrowable 443 443 { 444 444 return first.equalp(second) ? T : NIL; … … 449 449 private static final Primitive2 CONS = new Primitive2("cons") { 450 450 public LispObject execute(LispObject first, LispObject second) 451 throws LispError451 throws ConditionThrowable 452 452 { 453 453 return new Cons(first, second); … … 458 458 private static final Primitive2 ELT = new Primitive2("elt") { 459 459 public LispObject execute(LispObject first, LispObject second) 460 throws LispError460 throws ConditionThrowable 461 461 { 462 462 return first.elt(Fixnum.getValue(second)); … … 467 467 private static final SpecialOperator QUOTE = new SpecialOperator("quote") { 468 468 public LispObject execute(LispObject args, Environment env) 469 throws LispError469 throws ConditionThrowable 470 470 { 471 471 return args.car(); … … 475 475 // ### atom 476 476 private static final Primitive1 ATOM = new Primitive1("atom") { 477 public LispObject execute(LispObject arg) throws LispError477 public LispObject execute(LispObject arg) throws ConditionThrowable 478 478 { 479 479 return arg instanceof Cons ? NIL : T; … … 483 483 // ### constantp 484 484 private static final Primitive CONSTANTP = new Primitive("constantp") { 485 public LispObject execute(LispObject arg) throws LispError485 public LispObject execute(LispObject arg) throws ConditionThrowable 486 486 { 487 487 return arg.CONSTANTP(); 488 488 } 489 public LispObject execute(LispObject first, LispObject second) throws LispError489 public LispObject execute(LispObject first, LispObject second) throws ConditionThrowable 490 490 { 491 491 return first.CONSTANTP(); … … 495 495 // ### symbolp 496 496 private static final Primitive1 SYMBOLP = new Primitive1("symbolp") { 497 public LispObject execute(LispObject arg) throws LispError497 public LispObject execute(LispObject arg) throws ConditionThrowable 498 498 { 499 499 return arg.SYMBOLP(); … … 503 503 // ### endp 504 504 private static final Primitive1 ENDP = new Primitive1("endp") { 505 public LispObject execute(LispObject arg) throws LispError505 public LispObject execute(LispObject arg) throws ConditionThrowable 506 506 { 507 507 return arg.ENDP(); … … 511 511 // ### null 512 512 private static final Primitive1 NULL = new Primitive1("null") { 513 public LispObject execute(LispObject arg) throws LispError513 public LispObject execute(LispObject arg) throws ConditionThrowable 514 514 { 515 515 return arg == NIL ? T : NIL; … … 519 519 // ### not 520 520 private static final Primitive1 NOT = new Primitive1("not") { 521 public LispObject execute(LispObject arg) throws LispError521 public LispObject execute(LispObject arg) throws ConditionThrowable 522 522 { 523 523 return arg == NIL ? T : NIL; … … 552 552 private static final Primitive1 FIXNUMP = 553 553 new Primitive1("fixnump", PACKAGE_SYS, false) { 554 public LispObject execute(LispObject arg) throws LispError554 public LispObject execute(LispObject arg) throws ConditionThrowable 555 555 { 556 556 return arg instanceof Fixnum ? T : NIL; … … 561 561 private static final Primitive ADD = new Primitive("+") { 562 562 public LispObject execute(LispObject first, LispObject second) 563 throws LispError563 throws ConditionThrowable 564 564 { 565 565 return first.add(second); 566 566 } 567 public LispObject execute(LispObject[] args) throws LispError567 public LispObject execute(LispObject[] args) throws ConditionThrowable 568 568 { 569 569 LispObject result = Fixnum.ZERO; … … 578 578 private static final Primitive SUBTRACT = new Primitive("-") { 579 579 public LispObject execute(LispObject first, LispObject second) 580 throws LispError580 throws ConditionThrowable 581 581 { 582 582 return first.subtract(second); 583 583 } 584 public LispObject execute(LispObject[] args) throws LispError584 public LispObject execute(LispObject[] args) throws ConditionThrowable 585 585 { 586 586 switch (args.length) { 587 587 case 0: 588 throw new WrongNumberOfArgumentsException("-");588 throw new ConditionThrowable(new WrongNumberOfArgumentsException("-")); 589 589 case 1: 590 590 return Fixnum.ZERO.subtract(args[0]); … … 620 620 } 621 621 default: 622 throw new WrongNumberOfArgumentsException("IF");622 throw new ConditionThrowable(new WrongNumberOfArgumentsException("IF")); 623 623 } 624 624 } … … 631 631 { 632 632 if (args == NIL) 633 throw new WrongNumberOfArgumentsException(this);633 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 634 634 final LispThread thread = LispThread.currentThread(); 635 635 LispObject result = NIL; … … 652 652 { 653 653 if (args == NIL) 654 throw new WrongNumberOfArgumentsException(this);654 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 655 655 final LispThread thread = LispThread.currentThread(); 656 656 LispObject result = NIL; … … 668 668 // ### princ 669 669 private static final Primitive PRINC = new Primitive("princ") { 670 public LispObject execute(LispObject[] args) throws LispError670 public LispObject execute(LispObject[] args) throws ConditionThrowable 671 671 { 672 672 if (args.length < 1 || args.length > 2) 673 throw new WrongNumberOfArgumentsException(this);673 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 674 674 CharacterOutputStream out = null; 675 675 if (args.length == 2) { … … 690 690 private static final Primitive1 PRINC_TO_STRING = 691 691 new Primitive1("princ-to-string") { 692 public LispObject execute(LispObject arg) throws LispError692 public LispObject execute(LispObject arg) throws ConditionThrowable 693 693 { 694 694 LispThread thread = LispThread.currentThread(); … … 704 704 // prin1 object &optional output-stream => object 705 705 private static final Primitive PRIN1 = new Primitive("prin1") { 706 public LispObject execute(LispObject arg) throws LispError706 public LispObject execute(LispObject arg) throws ConditionThrowable 707 707 { 708 708 CharacterOutputStream out = getStandardOutput(); … … 712 712 } 713 713 public LispObject execute(LispObject first, LispObject second) 714 throws LispError714 throws ConditionThrowable 715 715 { 716 716 CharacterOutputStream out; … … 731 731 private static final Primitive1 PRIN1_TO_STRING = 732 732 new Primitive1("prin1-to-string") { 733 public LispObject execute(LispObject arg) throws LispError733 public LispObject execute(LispObject arg) throws ConditionThrowable 734 734 { 735 735 return new LispString(String.valueOf(arg)); … … 741 741 // object is preceded by a newline and followed by a space. 742 742 private static final Primitive1 PRINT = new Primitive1("print") { 743 public LispObject execute(LispObject arg) throws LispError743 public LispObject execute(LispObject arg) throws ConditionThrowable 744 744 { 745 745 CharacterOutputStream out = getStandardOutput(); … … 755 755 // ### terpri 756 756 private static final Primitive TERPRI = new Primitive("terpri") { 757 public LispObject execute(LispObject[] args) throws LispError757 public LispObject execute(LispObject[] args) throws ConditionThrowable 758 758 { 759 759 if (args.length > 1) 760 throw new WrongNumberOfArgumentsException(this);760 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 761 761 CharacterOutputStream out = null; 762 762 if (args.length == 1) { … … 774 774 // ### fresh-line 775 775 private static final Primitive FRESH_LINE = new Primitive("fresh-line") { 776 public LispObject execute(LispObject[] args) throws LispError776 public LispObject execute(LispObject[] args) throws ConditionThrowable 777 777 { 778 778 if (args.length > 1) 779 throw new WrongNumberOfArgumentsException(this);779 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 780 780 CharacterOutputStream out; 781 781 if (args.length == 1) … … 789 789 // ### boundp 790 790 private static final Primitive1 BOUNDP = new Primitive1("boundp") { 791 public LispObject execute(LispObject obj) throws LispError791 public LispObject execute(LispObject obj) throws ConditionThrowable 792 792 { 793 793 if (obj == NIL) … … 811 811 } 812 812 public LispObject execute(LispObject first, LispObject second) 813 throws LispError813 throws ConditionThrowable 814 814 { 815 815 if (first == NIL) … … 828 828 return result; 829 829 } 830 public LispObject execute(LispObject[] args) throws LispError830 public LispObject execute(LispObject[] args) throws ConditionThrowable 831 831 { 832 832 Cons result = null; … … 867 867 // ### nconc 868 868 private static final Primitive NCONC = new Primitive("nconc") { 869 public LispObject execute(LispObject[] array) throws LispError869 public LispObject execute(LispObject[] array) throws ConditionThrowable 870 870 { 871 871 switch (array.length) { … … 913 913 private static final Primitive EQUALS = new Primitive("=") { 914 914 public LispObject execute(LispObject first, LispObject second) 915 throws LispError915 throws ConditionThrowable 916 916 { 917 917 return first.isEqualTo(second) ? T : NIL; 918 918 } 919 public LispObject execute(LispObject[] array) throws LispError919 public LispObject execute(LispObject[] array) throws ConditionThrowable 920 920 { 921 921 final int length = array.length; 922 922 if (length < 1) 923 throw new WrongNumberOfArgumentsException(this);923 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 924 924 final LispObject obj = array[0]; 925 925 for (int i = 1; i < length; i++) { … … 934 934 private static final Primitive NOT_EQUALS = new Primitive("/=") { 935 935 public LispObject execute(LispObject first, LispObject second) 936 throws LispError936 throws ConditionThrowable 937 937 { 938 938 return first.isNotEqualTo(second) ? T : NIL; 939 939 } 940 public LispObject execute(LispObject[] array) throws LispError940 public LispObject execute(LispObject[] array) throws ConditionThrowable 941 941 { 942 942 final int length = array.length; … … 944 944 return array[0].isNotEqualTo(array[1]) ? T : NIL; 945 945 if (length < 1) 946 throw new WrongNumberOfArgumentsException(this);946 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 947 947 for (int i = 0; i < length; i++) { 948 948 final LispObject obj = array[i]; … … 960 960 private static final Primitive LESS_THAN = new Primitive("<") { 961 961 public LispObject execute(LispObject first, LispObject second) 962 throws LispError962 throws ConditionThrowable 963 963 { 964 964 return first.isLessThan(second) ? T : NIL; 965 965 } 966 public LispObject execute(LispObject[] array) throws LispError966 public LispObject execute(LispObject[] array) throws ConditionThrowable 967 967 { 968 968 final int length = array.length; 969 969 if (length < 1) 970 throw new WrongNumberOfArgumentsException(this);970 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 971 971 for (int i = 1; i < length; i++) { 972 972 if (array[i].isLessThanOrEqualTo(array[i-1])) … … 980 980 private static final Primitive LE = new Primitive("<=") { 981 981 public LispObject execute(LispObject first, LispObject second) 982 throws LispError982 throws ConditionThrowable 983 983 { 984 984 return first.isLessThanOrEqualTo(second) ? T : NIL; 985 985 } 986 public LispObject execute(LispObject[] array) throws LispError986 public LispObject execute(LispObject[] array) throws ConditionThrowable 987 987 { 988 988 switch (array.length) { 989 989 case 0: 990 throw new WrongNumberOfArgumentsException(this);990 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 991 991 case 1: 992 992 return T; … … 1009 1009 private static final Primitive GREATER_THAN = new Primitive(">") { 1010 1010 public LispObject execute(LispObject first, LispObject second) 1011 throws LispError1011 throws ConditionThrowable 1012 1012 { 1013 1013 return first.isGreaterThan(second) ? T : NIL; 1014 1014 } 1015 public LispObject execute(LispObject[] array) throws LispError1015 public LispObject execute(LispObject[] array) throws ConditionThrowable 1016 1016 { 1017 1017 final int length = array.length; 1018 1018 if (length < 1) 1019 throw new WrongNumberOfArgumentsException(this);1019 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1020 1020 for (int i = 1; i < length; i++) { 1021 1021 if (array[i].isGreaterThanOrEqualTo(array[i-1])) … … 1029 1029 private static final Primitive GE = new Primitive(">=") { 1030 1030 public LispObject execute(LispObject first, LispObject second) 1031 throws LispError1031 throws ConditionThrowable 1032 1032 { 1033 1033 return first.isGreaterThanOrEqualTo(second) ? T : NIL; 1034 1034 } 1035 public LispObject execute(LispObject[] array) throws LispError1035 public LispObject execute(LispObject[] array) throws ConditionThrowable 1036 1036 { 1037 1037 final int length = array.length; 1038 1038 switch (length) { 1039 1039 case 0: 1040 throw new WrongNumberOfArgumentsException(this);1040 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1041 1041 case 1: 1042 1042 return T; … … 1059 1059 // Redefined properly in list.lisp. 1060 1060 private static final Primitive ASSOC = new Primitive("assoc") { 1061 public LispObject execute(LispObject[] args) throws LispError1061 public LispObject execute(LispObject[] args) throws ConditionThrowable 1062 1062 { 1063 1063 if (args.length != 2) 1064 throw new WrongNumberOfArgumentsException(this);1064 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1065 1065 LispObject item = args[0]; 1066 1066 LispObject alist = args[1]; … … 1082 1082 private static final Primitive2 NTH = new Primitive2("nth") { 1083 1083 public LispObject execute(LispObject first, LispObject second) 1084 throws LispError1084 throws ConditionThrowable 1085 1085 { 1086 1086 int index = Fixnum.getValue(first); … … 1104 1104 new Primitive3("%setnth", PACKAGE_SYS, false) { 1105 1105 public LispObject execute(LispObject first, LispObject second, 1106 LispObject third) throws LispError1106 LispObject third) throws ConditionThrowable 1107 1107 { 1108 1108 int index = Fixnum.getValue(first); … … 1127 1127 private static final Primitive2 NTHCDR = new Primitive2("nthcdr") { 1128 1128 public LispObject execute(LispObject first, LispObject second) 1129 throws LispError1129 throws ConditionThrowable 1130 1130 { 1131 1131 final int index = Fixnum.getValue(first); … … 1146 1146 { 1147 1147 if (args.length < 1) 1148 throw new WrongNumberOfArgumentsException(this);1148 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1149 1149 LispObject datum = args[0]; 1150 1150 if (datum instanceof Symbol) { … … 1154 1154 throw new ConditionThrowable(new ParseError(_format(args, 1))); 1155 1155 if (datum == Symbol.PROGRAM_ERROR) 1156 throw new ProgramError(_format(args, 1));1156 throw new ConditionThrowable(new ProgramError(_format(args, 1))); 1157 1157 if (datum == Symbol.TYPE_ERROR) 1158 1158 throw new TypeError(_format(args, 1)); … … 1169 1169 { 1170 1170 if (args.length < 1) 1171 throw new WrongNumberOfArgumentsException(this);1171 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1172 1172 throw new SimpleCondition(); 1173 1173 } … … 1176 1176 // ### format 1177 1177 private static final Primitive FORMAT = new Primitive("format") { 1178 public LispObject execute(LispObject[] args) throws LispError1178 public LispObject execute(LispObject[] args) throws ConditionThrowable 1179 1179 { 1180 1180 if (args.length < 2) 1181 throw new WrongNumberOfArgumentsException(this);1181 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1182 1182 LispObject destination = args[0]; 1183 1183 // Copy remaining arguments. … … 1207 1207 1208 1208 private static final String _format(LispObject[] args, int skip) 1209 throws LispError1209 throws ConditionThrowable 1210 1210 { 1211 1211 final int remaining = args.length - skip; … … 1219 1219 } 1220 1220 1221 private static final String _format(LispObject[] args) throws LispError1221 private static final String _format(LispObject[] args) throws ConditionThrowable 1222 1222 { 1223 1223 final LispThread thread = LispThread.currentThread(); … … 1292 1292 new Primitive3("%defun", PACKAGE_SYS, false) { 1293 1293 public LispObject execute(LispObject first, LispObject second, 1294 LispObject third) throws LispError1294 LispObject third) throws ConditionThrowable 1295 1295 { 1296 1296 Symbol symbol = checkSymbol(first); … … 1317 1317 new SpecialOperator("lambda") { 1318 1318 public LispObject execute(LispObject args, Environment env) 1319 throws LispError1319 throws ConditionThrowable 1320 1320 { 1321 1321 return new Closure(args.car(), args.cdr(), env); … … 1327 1327 private static final Primitive MACRO_FUNCTION = 1328 1328 new Primitive("macro-function") { 1329 public LispObject execute(LispObject[] args) throws LispError1329 public LispObject execute(LispObject[] args) throws ConditionThrowable 1330 1330 { 1331 1331 if (args.length != 1) 1332 throw new WrongNumberOfArgumentsException(this);1332 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1333 1333 Symbol symbol = checkSymbol(args[0]); 1334 1334 LispObject obj = symbol.getSymbolFunction(); … … 1353 1353 new SpecialOperator("defmacro") { 1354 1354 public LispObject execute(LispObject args, Environment env) 1355 throws LispError1355 throws ConditionThrowable 1356 1356 { 1357 1357 Symbol symbol = checkSymbol(args.car()); … … 1381 1381 private static final Primitive1 MAKE_MACRO = 1382 1382 new Primitive1("make-macro", PACKAGE_SYS, false) { 1383 public LispObject execute(LispObject arg) throws LispError1383 public LispObject execute(LispObject arg) throws ConditionThrowable 1384 1384 { 1385 1385 return new MacroObject(arg); … … 1392 1392 public LispObject execute(LispObject first, LispObject second, 1393 1393 LispObject third) 1394 throws LispError1394 throws ConditionThrowable 1395 1395 { 1396 1396 Symbol symbol = checkSymbol(first); … … 1408 1408 private static final Primitive1 _DEFVAR = 1409 1409 new Primitive1("%defvar", PACKAGE_SYS, false) { 1410 public LispObject execute(LispObject arg) throws LispError1410 public LispObject execute(LispObject arg) throws ConditionThrowable 1411 1411 { 1412 1412 Symbol symbol = checkSymbol(arg); … … 1421 1421 public LispObject execute(LispObject first, LispObject second, 1422 1422 LispObject third) 1423 throws LispError1423 throws ConditionThrowable 1424 1424 { 1425 1425 Symbol symbol = checkSymbol(first); … … 1801 1801 return c.getCondition() instanceof ParseError; 1802 1802 if (type == Symbol.PROGRAM_ERROR) 1803 return c instanceof ProgramError;1803 return c.getCondition() instanceof ProgramError; 1804 1804 if (type == Symbol.CONTROL_ERROR) 1805 1805 return c instanceof ControlError; 1806 1806 if (type == Symbol.SIMPLE_ERROR) 1807 1807 return c instanceof SimpleError; 1808 if (type == Symbol.ERROR) 1809 return c instanceof LispError; 1808 if (type == Symbol.ERROR) { 1809 if (c instanceof LispError) 1810 return true; 1811 Condition condition = c.getCondition(); 1812 if (condition instanceof ParseError) 1813 return true; 1814 if (condition instanceof ProgramError) 1815 return true; 1816 return false; 1817 } 1810 1818 if (type == Symbol.SIMPLE_CONDITION) 1811 1819 return c instanceof SimpleCondition; … … 1823 1831 private static final Primitive UPGRADED_ARRAY_ELEMENT_TYPE = 1824 1832 new Primitive("upgraded-array-element-type") { 1825 public LispObject execute(LispObject arg) throws LispError1833 public LispObject execute(LispObject arg) throws ConditionThrowable 1826 1834 { 1827 1835 return getUpgradedArrayElementType(arg); 1828 1836 } 1829 1837 public LispObject execute(LispObject first, LispObject second) 1830 throws LispError1838 throws ConditionThrowable 1831 1839 { 1832 1840 // Ignore environment. … … 1839 1847 private static final Primitive1 ARRAY_RANK = 1840 1848 new Primitive1("array-rank") { 1841 public LispObject execute(LispObject arg) throws LispError1849 public LispObject execute(LispObject arg) throws ConditionThrowable 1842 1850 { 1843 1851 return new Fixnum(checkArray(arg).getRank()); … … 1850 1858 private static final Primitive1 ARRAY_DIMENSIONS = 1851 1859 new Primitive1("array-dimensions") { 1852 public LispObject execute(LispObject arg) throws LispError1860 public LispObject execute(LispObject arg) throws ConditionThrowable 1853 1861 { 1854 1862 return checkArray(arg).getDimensions(); … … 1861 1869 new Primitive2("array-dimension") { 1862 1870 public LispObject execute(LispObject first, LispObject second) 1863 throws LispError1871 throws ConditionThrowable 1864 1872 { 1865 1873 return new Fixnum(checkArray(first).getDimension(Fixnum.getValue(second))); … … 1871 1879 private static final Primitive1 ARRAY_TOTAL_SIZE = 1872 1880 new Primitive1("array-total-size") { 1873 public LispObject execute(LispObject arg) throws LispError1881 public LispObject execute(LispObject arg) throws ConditionThrowable 1874 1882 { 1875 1883 return new Fixnum(checkArray(arg).getTotalSize()); … … 1882 1890 private static final Primitive1 ARRAY_ELEMENT_TYPE = 1883 1891 new Primitive1("array-element-type") { 1884 public LispObject execute(LispObject arg) throws LispError1892 public LispObject execute(LispObject arg) throws ConditionThrowable 1885 1893 { 1886 1894 return checkArray(arg).getElementType(); … … 1892 1900 private static final Primitive ARRAY_IN_BOUNDS_P = 1893 1901 new Primitive("array-in-bounds-p") { 1894 public LispObject execute(LispObject[] args) throws LispError1902 public LispObject execute(LispObject[] args) throws ConditionThrowable 1895 1903 { 1896 1904 if (args.length < 1) 1897 throw new WrongNumberOfArgumentsException(this);1905 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1898 1906 AbstractArray array = checkArray(args[0]); 1899 1907 int rank = array.getRank(); … … 1904 1912 sb.append(") for array of rank "); 1905 1913 sb.append(rank); 1906 throw new ProgramError(sb.toString());1914 throw new ConditionThrowable(new ProgramError(sb.toString())); 1907 1915 } 1908 1916 for (int i = 0; i < rank; i++) { … … 1926 1934 new Primitive2("%array-row-major-index", PACKAGE_SYS, false) { 1927 1935 public LispObject execute(LispObject first, LispObject second) 1928 throws LispError1936 throws ConditionThrowable 1929 1937 { 1930 1938 AbstractArray array = checkArray(first); … … 1937 1945 // aref array &rest subscripts => element 1938 1946 private static final Primitive AREF = new Primitive("aref") { 1939 public LispObject execute(LispObject arg) throws LispError1947 public LispObject execute(LispObject arg) throws ConditionThrowable 1940 1948 { 1941 1949 AbstractArray array = checkArray(arg); … … 1945 1953 sb.append("wrong number of subscripts (0) for array of rank "); 1946 1954 sb.append(array.getRank()); 1947 throw new ProgramError(sb.toString());1955 throw new ConditionThrowable(new ProgramError(sb.toString())); 1948 1956 } 1949 1957 public LispObject execute(LispObject first, LispObject second) 1950 throws LispError1958 throws ConditionThrowable 1951 1959 { 1952 1960 return first.AREF(second); 1953 1961 } 1954 public LispObject execute(LispObject[] args) throws LispError1962 public LispObject execute(LispObject[] args) throws ConditionThrowable 1955 1963 { 1956 1964 if (args.length < 1) 1957 throw new WrongNumberOfArgumentsException(this);1965 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 1958 1966 AbstractArray array = checkArray(args[0]); 1959 1967 LispObject[] subscripts = new LispObject[args.length - 1]; … … 1966 1974 1967 1975 private static final int arrayRowMajorIndex(AbstractArray array, 1968 LispObject[] subscripts) throws LispError1976 LispObject[] subscripts) throws ConditionThrowable 1969 1977 { 1970 1978 final int rank = array.getRank(); … … 1975 1983 sb.append(") for array of rank "); 1976 1984 sb.append(rank); 1977 throw new ProgramError(sb.toString());1985 throw new ConditionThrowable(new ProgramError(sb.toString())); 1978 1986 } 1979 1987 if (rank == 0) … … 1989 1997 int n = ((Fixnum)subscript).getValue(); 1990 1998 if (n < 0 || n >= array.getDimension(i)) 1991 throw new ProgramError();1999 throw new ConditionThrowable(new ProgramError()); 1992 2000 sum += n * lastSize; 1993 2001 } else if (subscript instanceof Bignum) { 1994 throw new ProgramError();2002 throw new ConditionThrowable(new ProgramError()); 1995 2003 } else 1996 2004 throw new TypeError(subscript, "integer"); … … 2004 2012 new Primitive2("row-major-aref") { 2005 2013 public LispObject execute(LispObject first, LispObject second) 2006 throws LispError2014 throws ConditionThrowable 2007 2015 { 2008 2016 return checkArray(first).getRowMajor(Fixnum.getValue(second)); … … 2015 2023 new Primitive3("%set-row-major-aref", PACKAGE_SYS, false) { 2016 2024 public LispObject execute(LispObject first, LispObject second, 2017 LispObject third) throws LispError2025 LispObject third) throws ConditionThrowable 2018 2026 { 2019 2027 checkArray(first).setRowMajor(Fixnum.getValue(second), third); … … 2024 2032 // ### vector 2025 2033 private static final Primitive VECTOR = new Primitive("vector") { 2026 public LispObject execute(LispObject[] args) throws LispError2034 public LispObject execute(LispObject[] args) throws ConditionThrowable 2027 2035 { 2028 2036 return new Vector(args); … … 2034 2042 private static final Primitive2 SVREF = new Primitive2("svref") { 2035 2043 public LispObject execute(LispObject first, LispObject second) 2036 throws LispError2044 throws ConditionThrowable 2037 2045 { 2038 2046 AbstractVector v = checkVector(first); … … 2050 2058 public LispObject execute(LispObject first, LispObject second, 2051 2059 LispObject third) 2052 throws LispError2060 throws ConditionThrowable 2053 2061 { 2054 2062 AbstractVector v = checkVector(first); … … 2065 2073 new Primitive1("fill-pointer") { 2066 2074 public LispObject execute(LispObject arg) 2067 throws LispError2075 throws ConditionThrowable 2068 2076 { 2069 2077 int fillPointer = checkVector(arg).getFillPointer(); … … 2078 2086 new Primitive2("%set-fill-pointer", PACKAGE_SYS, false) { 2079 2087 public LispObject execute(LispObject first, LispObject second) 2080 throws LispError2088 throws ConditionThrowable 2081 2089 { 2082 2090 AbstractVector v = checkVector(first); … … 2094 2102 new Primitive2("vector-push") { 2095 2103 public LispObject execute(LispObject first, LispObject second) 2096 throws LispError2104 throws ConditionThrowable 2097 2105 { 2098 2106 AbstractVector v = checkVector(second); … … 2112 2120 private static final Primitive VECTOR_PUSH_EXTEND = 2113 2121 new Primitive("vector-push-extend") { 2114 public LispObject execute(LispObject[] args) throws LispError2122 public LispObject execute(LispObject[] args) throws ConditionThrowable 2115 2123 { 2116 2124 if (args.length < 2 || args.length > 3) 2117 throw new WrongNumberOfArgumentsException(this);2125 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2118 2126 AbstractVector v = checkVector(args[1]); 2119 2127 int extension = 0; … … 2139 2147 // vector-pop vector => element 2140 2148 private static final Primitive1 VECTOR_POP = new Primitive1("vector-pop") { 2141 public LispObject execute(LispObject arg) throws LispError2149 public LispObject execute(LispObject arg) throws ConditionThrowable 2142 2150 { 2143 2151 AbstractVector v = checkVector(arg); … … 2156 2164 // ### type-of 2157 2165 private static final Primitive1 TYPE_OF = new Primitive1("type-of") { 2158 public LispObject execute(LispObject arg) throws LispError2166 public LispObject execute(LispObject arg) throws ConditionThrowable 2159 2167 { 2160 2168 return arg.typeOf(); … … 2164 2172 // ### class-of 2165 2173 private static final Primitive1 CLASS_OF = new Primitive1("class-of") { 2166 public LispObject execute(LispObject arg) throws LispError2174 public LispObject execute(LispObject arg) throws ConditionThrowable 2167 2175 { 2168 2176 return arg.classOf(); … … 2175 2183 { 2176 2184 public LispObject execute(LispObject first, LispObject second) 2177 throws LispError2185 throws ConditionThrowable 2178 2186 { 2179 2187 return first.typep(second); … … 2185 2193 private static final Primitive1 FUNCTION_LAMBDA_EXPRESSION = 2186 2194 new Primitive1("function-lambda-expression") { 2187 public LispObject execute(LispObject arg) throws LispError2195 public LispObject execute(LispObject arg) throws ConditionThrowable 2188 2196 { 2189 2197 LispObject[] values = new LispObject[3]; … … 2251 2259 { 2252 2260 if (args.length < 1) 2253 throw new WrongNumberOfArgumentsException(this);2261 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2254 2262 LispObject fun; 2255 2263 if (args[0] instanceof Symbol) … … 2309 2317 final int numArgs = args.length; 2310 2318 if (numArgs < 2) 2311 throw new WrongNumberOfArgumentsException(this);2319 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2312 2320 LispObject spread = checkList(args[numArgs - 1]); 2313 2321 LispObject fun = args[0]; … … 2395 2403 final int numArgs = args.length; 2396 2404 if (numArgs < 2) 2397 throw new WrongNumberOfArgumentsException(this);2405 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2398 2406 // First argument must be a function. 2399 2407 LispObject fun = args[0]; … … 2437 2445 final int length = args.length; 2438 2446 if (length < 1 || length > 2) 2439 throw new WrongNumberOfArgumentsException(this);2447 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2440 2448 LispObject form = args[0]; 2441 2449 Environment env = … … 2452 2460 final int length = args.length; 2453 2461 if (length < 1 || length > 2) 2454 throw new WrongNumberOfArgumentsException(this);2462 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2455 2463 LispObject form = args[0]; 2456 2464 Environment env = … … 2470 2478 // ### gensym 2471 2479 private static final Primitive GENSYM = new Primitive("gensym") { 2472 public LispObject execute(LispObject[] args) throws LispError2480 public LispObject execute(LispObject[] args) throws ConditionThrowable 2473 2481 { 2474 2482 if (args.length > 1) 2475 throw new WrongNumberOfArgumentsException(this);2483 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2476 2484 String prefix = "G"; 2477 2485 if (args.length == 1) { … … 2504 2512 }; 2505 2513 2506 private static final Symbol gensym() throws LispError2514 private static final Symbol gensym() throws ConditionThrowable 2507 2515 { 2508 2516 return gensym("G"); 2509 2517 } 2510 2518 2511 private static final Symbol gensym(String prefix) throws LispError2519 private static final Symbol gensym(String prefix) throws ConditionThrowable 2512 2520 { 2513 2521 LispObject oldValue; … … 2530 2538 // ### string 2531 2539 private static final Primitive1 STRING = new Primitive1("string") { 2532 public LispObject execute(LispObject arg) throws LispError2540 public LispObject execute(LispObject arg) throws ConditionThrowable 2533 2541 { 2534 2542 return string(arg); … … 2540 2548 // status is one of :INHERITED, :EXTERNAL, :INTERNAL or NIL. 2541 2549 private static final Primitive INTERN = new Primitive("intern") { 2542 public LispObject execute(LispObject[] args) throws LispError2550 public LispObject execute(LispObject[] args) throws ConditionThrowable 2543 2551 { 2544 2552 final LispThread thread = LispThread.currentThread(); … … 2554 2562 } 2555 2563 default: 2556 throw new WrongNumberOfArgumentsException(this);2564 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2557 2565 } 2558 2566 } … … 2562 2570 // unintern symbol &optional package => generalized-boolean 2563 2571 private static final Primitive UNINTERN = new Primitive("unintern") { 2564 public LispObject execute(LispObject[] args) throws LispError2572 public LispObject execute(LispObject[] args) throws ConditionThrowable 2565 2573 { 2566 2574 if (args.length == 0 || args.length > 2) 2567 throw new WrongNumberOfArgumentsException(this);2575 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2568 2576 Symbol symbol = checkSymbol(args[0]); 2569 2577 Package pkg; … … 2579 2587 private static final Primitive1 FIND_PACKAGE = 2580 2588 new Primitive1("find-package") { 2581 public LispObject execute(LispObject arg) throws LispError2589 public LispObject execute(LispObject arg) throws ConditionThrowable 2582 2590 { 2583 2591 if (arg instanceof Package) … … 2608 2616 public LispObject execute(LispObject first, LispObject second, 2609 2617 LispObject third) 2610 throws LispError2618 throws ConditionThrowable 2611 2619 { 2612 2620 String packageName = javaString(first); … … 2675 2683 private static final Primitive1 _IN_PACKAGE = 2676 2684 new Primitive1("%in-package", PACKAGE_SYS, false) { 2677 public LispObject execute(LispObject arg) throws LispError2685 public LispObject execute(LispObject arg) throws ConditionThrowable 2678 2686 { 2679 2687 String packageName = javaString(arg); … … 2699 2707 // use-package packages-to-use &optional package => t 2700 2708 private static final Primitive USE_PACKAGE = new Primitive("use-package") { 2701 public LispObject execute(LispObject[] args) throws LispError2709 public LispObject execute(LispObject[] args) throws ConditionThrowable 2702 2710 { 2703 2711 if (args.length < 1 || args.length > 2) 2704 throw new WrongNumberOfArgumentsException(this);2712 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2705 2713 Package pkg; 2706 2714 if (args.length == 2) … … 2837 2845 private static final Primitive EXPORT = 2838 2846 new Primitive("export") { 2839 public LispObject execute(LispObject[] args) throws LispError2847 public LispObject execute(LispObject[] args) throws ConditionThrowable 2840 2848 { 2841 2849 if (args.length == 0 || args.length > 2) 2842 throw new WrongNumberOfArgumentsException(this);2850 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2843 2851 Package pkg; 2844 2852 if (args.length == 2) … … 2860 2868 private static final Primitive FIND_SYMBOL = 2861 2869 new Primitive("find-symbol") { 2862 public LispObject execute(LispObject[] args) throws LispError2870 public LispObject execute(LispObject[] args) throws ConditionThrowable 2863 2871 { 2864 2872 if (args.length == 0 || args.length > 2) 2865 throw new WrongNumberOfArgumentsException(this);2873 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2866 2874 String name = LispString.getValue(args[0]); 2867 2875 Package pkg; … … 2878 2886 new Primitive2("fset", PACKAGE_SYS, false) { 2879 2887 public LispObject execute(LispObject first, LispObject second) 2880 throws LispError2888 throws ConditionThrowable 2881 2889 { 2882 2890 Symbol symbol = checkSymbol(first); … … 2913 2921 new Primitive2("%set-symbol-plist", PACKAGE_SYS, false) { 2914 2922 public LispObject execute(LispObject first, LispObject second) 2915 throws LispError2923 throws ConditionThrowable 2916 2924 { 2917 2925 checkSymbol(first).setPropertyList(checkList(second)); … … 2923 2931 // get symbol indicator &optional default => value 2924 2932 private static final Primitive GET = new Primitive("get") { 2925 public LispObject execute(LispObject[] args) throws LispError2933 public LispObject execute(LispObject[] args) throws ConditionThrowable 2926 2934 { 2927 2935 Symbol symbol; … … 2940 2948 break; 2941 2949 default: 2942 throw new WrongNumberOfArgumentsException(this);2950 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 2943 2951 } 2944 2952 return get(symbol, indicator, defaultValue); … … 2951 2959 new Primitive3("%put", PACKAGE_SYS, false) { 2952 2960 public LispObject execute(LispObject first, LispObject second, 2953 LispObject third) throws LispError2961 LispObject third) throws ConditionThrowable 2954 2962 { 2955 2963 Symbol symbol = checkSymbol(first); … … 3155 3163 private static final SpecialOperator GO = new SpecialOperator("go") { 3156 3164 public LispObject execute(LispObject args, Environment env) 3157 throws LispError3165 throws ConditionThrowable 3158 3166 { 3159 3167 if (args.length() != 1) 3160 throw new WrongNumberOfArgumentsException(this);3168 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3161 3169 throw new Go(args.car()); 3162 3170 } … … 3169 3177 { 3170 3178 if (args == NIL) 3171 throw new WrongNumberOfArgumentsException(this);3179 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3172 3180 LispObject tag; 3173 3181 if (args.car() == NIL) … … 3214 3222 final int length = args.length(); 3215 3223 if (length < 1 || length > 2) 3216 throw new WrongNumberOfArgumentsException(this);3224 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3217 3225 Symbol symbol = checkSymbol(args.car()); 3218 3226 Block block = env.lookupBlock(symbol); … … 3247 3255 LispThread.currentThread())); 3248 3256 default: 3249 throw new WrongNumberOfArgumentsException(this);3257 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3250 3258 } 3251 3259 } … … 3258 3266 { 3259 3267 if (args.length() < 1) 3260 throw new WrongNumberOfArgumentsException(this);3268 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3261 3269 final LispThread thread = LispThread.currentThread(); 3262 3270 LispObject tag = eval(args.car(), env, thread); … … 3290 3298 { 3291 3299 if (args.length() < 2) 3292 throw new WrongNumberOfArgumentsException(this);3300 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3293 3301 final LispThread thread = LispThread.currentThread(); 3294 3302 LispObject tag = eval(args.car(), env, thread); … … 3440 3448 { 3441 3449 if (args.length() != 2) 3442 throw new WrongNumberOfArgumentsException(this);3450 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3443 3451 LispObject vars = args.car(); 3444 3452 LispObject form = args.cadr(); … … 3491 3499 { 3492 3500 if (args.length() == 0) 3493 throw new WrongNumberOfArgumentsException(this);3501 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3494 3502 final LispThread thread = LispThread.currentThread(); 3495 3503 LispObject result = eval(args.car(), env, thread); … … 3509 3517 { 3510 3518 if (args.length() == 0) 3511 throw new WrongNumberOfArgumentsException(this);3519 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3512 3520 final LispThread thread = LispThread.currentThread(); 3513 3521 LispObject function; … … 3594 3602 { 3595 3603 if (args.length() != 1) 3596 throw new WrongNumberOfArgumentsException(this);3604 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3597 3605 if (eval(args.car(), env, LispThread.currentThread()) == NIL) 3598 3606 throw new LispError("assertion failed: " + args.car()); … … 3605 3613 private static final Primitive WRITE_CHAR = 3606 3614 new Primitive("write-char") { 3607 public LispObject execute(LispObject[] args) throws LispError3615 public LispObject execute(LispObject[] args) throws ConditionThrowable 3608 3616 { 3609 3617 if (args.length < 1 || args.length > 2) 3610 throw new WrongNumberOfArgumentsException(this);3618 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3611 3619 char c = LispCharacter.getValue(args[0]); 3612 3620 CharacterOutputStream out = null; … … 3632 3640 private static final Primitive WRITE_STRING = 3633 3641 new Primitive("write-string") { 3634 public LispObject execute(LispObject[] args) throws LispError3642 public LispObject execute(LispObject[] args) throws ConditionThrowable 3635 3643 { 3636 3644 if (args.length == 0) 3637 throw new WrongNumberOfArgumentsException(this);3645 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3638 3646 LispString string = checkString(args[0]); 3639 3647 CharacterOutputStream out = null; … … 3659 3667 private static final Primitive FINISH_OUTPUT = 3660 3668 new Primitive("finish-output") { 3661 public LispObject execute(LispObject[] args) throws LispError3669 public LispObject execute(LispObject[] args) throws ConditionThrowable 3662 3670 { 3663 3671 if (args.length > 1) 3664 throw new WrongNumberOfArgumentsException(this);3672 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3665 3673 CharacterOutputStream out = null; 3666 3674 if (args.length == 0) … … 3685 3693 // close stream &key abort => result 3686 3694 private static final Primitive CLOSE = new Primitive("close") { 3687 public LispObject execute(LispObject[] args) throws LispError3695 public LispObject execute(LispObject[] args) throws ConditionThrowable 3688 3696 { 3689 3697 final int length = args.length; 3690 3698 if (length == 0) 3691 throw new WrongNumberOfArgumentsException(this);3699 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3692 3700 LispObject abort = NIL; // Default. 3693 3701 LispStream stream = checkStream(args[0]); 3694 3702 if (length > 1) { 3695 3703 if ((length - 1) % 2 != 0) 3696 throw new ProgramError("odd number of keyword arguments");3704 throw new ConditionThrowable(new ProgramError("odd number of keyword arguments")); 3697 3705 if (length > 3) 3698 throw new WrongNumberOfArgumentsException(this);3706 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3699 3707 if (args[1] == Keyword.ABORT) 3700 3708 abort = args[2]; … … 3717 3725 { 3718 3726 if (args.length() != 1) 3719 throw new WrongNumberOfArgumentsException(this);3727 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3720 3728 final LispThread thread = LispThread.currentThread(); 3721 3729 LispObject result = eval(args.car(), env, thread); … … 3742 3750 { 3743 3751 if (args.length() != 2) 3744 throw new WrongNumberOfArgumentsException(this);3752 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3745 3753 final LispThread thread = LispThread.currentThread(); 3746 3754 int n = Fixnum.getInt(eval(args.car(), env, thread)); … … 3765 3773 new Primitive2("write-byte") { 3766 3774 public LispObject execute (LispObject first, LispObject second) 3767 throws LispError3775 throws ConditionThrowable 3768 3776 { 3769 3777 int n = Fixnum.getValue(first); … … 3782 3790 private static final Primitive READ_BYTE = 3783 3791 new Primitive("read-byte") { 3784 public LispObject execute (LispObject[] args) throws LispError3792 public LispObject execute (LispObject[] args) throws ConditionThrowable 3785 3793 { 3786 3794 int length = args.length; 3787 3795 if (length < 1 || length > 3) 3788 throw new WrongNumberOfArgumentsException(this);3796 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3789 3797 BinaryInputStream stream; 3790 3798 if (args[0] instanceof BinaryInputStream) … … 3807 3815 int length = args.length; 3808 3816 if (length > 4) 3809 throw new WrongNumberOfArgumentsException(this);3817 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3810 3818 CharacterInputStream stream; 3811 3819 if (length == 0) … … 3832 3840 { 3833 3841 if (args.length < 6) 3834 throw new WrongNumberOfArgumentsException(this);3842 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3835 3843 String s = LispString.getValue(args[0]); 3836 3844 boolean eofError = args[1] != NIL; … … 3865 3873 private static final Primitive1 STANDARD_CHAR_P = 3866 3874 new Primitive1("standard-char-p") { 3867 public LispObject execute(LispObject arg) throws LispError3875 public LispObject execute(LispObject arg) throws ConditionThrowable 3868 3876 { 3869 3877 return checkCharacter(arg).isStandardChar(); … … 3873 3881 private static final Primitive1 GRAPHIC_CHAR_P = 3874 3882 new Primitive1("graphic-char-p") { 3875 public LispObject execute(LispObject arg) throws LispError3883 public LispObject execute(LispObject arg) throws ConditionThrowable 3876 3884 { 3877 3885 char c = LispCharacter.getValue(arg); … … 3882 3890 private static final Primitive1 ALPHA_CHAR_P = 3883 3891 new Primitive1("alpha-char-p") { 3884 public LispObject execute(LispObject arg) throws LispError3892 public LispObject execute(LispObject arg) throws ConditionThrowable 3885 3893 { 3886 3894 char c = LispCharacter.getValue(arg); … … 3890 3898 3891 3899 private static final Primitive1 NAME_CHAR = new Primitive1("name-char") { 3892 public LispObject execute(LispObject arg) throws LispError3900 public LispObject execute(LispObject arg) throws ConditionThrowable 3893 3901 { 3894 3902 String s = LispString.getValue(string(arg)); … … 3899 3907 3900 3908 private static final Primitive1 CHAR_NAME = new Primitive1("char-name") { 3901 public LispObject execute(LispObject arg) throws LispError3909 public LispObject execute(LispObject arg) throws ConditionThrowable 3902 3910 { 3903 3911 char c = LispCharacter.getValue(arg); … … 3927 3935 3928 3936 private static final Primitive DIGIT_CHAR = new Primitive("digit-char") { 3929 public LispObject execute(LispObject[] args) throws LispError3937 public LispObject execute(LispObject[] args) throws ConditionThrowable 3930 3938 { 3931 3939 final long radix; … … 3938 3946 break; 3939 3947 default: 3940 throw new WrongNumberOfArgumentsException(this);3948 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3941 3949 } 3942 3950 long weight = Fixnum.getValue(args[0]); … … 3951 3959 private static final Primitive1 _CALL_COUNT = 3952 3960 new Primitive1("%call-count", PACKAGE_SYS, false) { 3953 public LispObject execute(LispObject arg) throws LispError3961 public LispObject execute(LispObject arg) throws ConditionThrowable 3954 3962 { 3955 3963 return new Fixnum(arg.getCallCount()); … … 3960 3968 new Primitive2("%set-call-count", PACKAGE_SYS, false) { 3961 3969 public LispObject execute(LispObject first, LispObject second) 3962 throws LispError3970 throws ConditionThrowable 3963 3971 { 3964 3972 first.setCallCount(Fixnum.getValue(second)); … … 3972 3980 private static final Primitive GET_DISPATCH_MACRO_CHARACTER = 3973 3981 new Primitive("get-dispatch-macro-character") { 3974 public LispObject execute(LispObject[] args) throws LispError3982 public LispObject execute(LispObject[] args) throws ConditionThrowable 3975 3983 { 3976 3984 if (args.length < 2 || args.length > 3) 3977 throw new WrongNumberOfArgumentsException(this);3985 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3978 3986 char dispChar = LispCharacter.getValue(args[0]); 3979 3987 char subChar = LispCharacter.getValue(args[1]); … … 3992 4000 private static final Primitive SET_DISPATCH_MACRO_CHARACTER = 3993 4001 new Primitive("set-dispatch-macro-character") { 3994 public LispObject execute(LispObject[] args) throws LispError4002 public LispObject execute(LispObject[] args) throws ConditionThrowable 3995 4003 { 3996 4004 if (args.length < 3 || args.length > 4) 3997 throw new WrongNumberOfArgumentsException(this);4005 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3998 4006 char dispChar = LispCharacter.getValue(args[0]); 3999 4007 char subChar = LispCharacter.getValue(args[1]); … … 4014 4022 int length = args.length; 4015 4023 if (length > 4) 4016 throw new WrongNumberOfArgumentsException(this);4024 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 4017 4025 CharacterInputStream stream = 4018 4026 length > 0 ? checkInputStream(args[0]) : getStandardInput(); … … 4027 4035 new Primitive2("%set-lambda-name", PACKAGE_SYS, false) { 4028 4036 public LispObject execute(LispObject first, LispObject second) 4029 throws LispError4037 throws ConditionThrowable 4030 4038 { 4031 4039 if (first instanceof Function) { … … 4044 4052 new Primitive2("shrink-vector", PACKAGE_SYS, false) { 4045 4053 public LispObject execute(LispObject first, LispObject second) 4046 throws LispError4054 throws ConditionThrowable 4047 4055 { 4048 4056 checkVector(first).shrink(Fixnum.getInt(second)); … … 4054 4062 new Primitive3("vector-subseq", PACKAGE_SYS, false) { 4055 4063 public LispObject execute(LispObject vector, LispObject start, 4056 LispObject end) throws LispError4064 LispObject end) throws ConditionThrowable 4057 4065 { 4058 4066 AbstractVector v = checkVector(vector); … … 4069 4077 int length = args.length; 4070 4078 if (length < 1 || length > 2) 4071 throw new WrongNumberOfArgumentsException(this);4079 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 4072 4080 Random random; 4073 4081 if (length == 2) … … 4116 4124 final int length = args.length; 4117 4125 if (length < 1 || length > 2) 4118 throw new WrongNumberOfArgumentsException(this);4126 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 4119 4127 LispObject n = args[0]; 4120 4128 LispObject d = length == 1 ? Fixnum.ONE : args[1]; … … 4135 4143 private static final Primitive2 ASH = new Primitive2("ash") { 4136 4144 public LispObject execute(LispObject first, LispObject second) 4137 throws LispError4145 throws ConditionThrowable 4138 4146 { 4139 4147 BigInteger n; … … 4170 4178 public static final Primitive2 EXPT = new Primitive2("expt") { 4171 4179 public LispObject execute(LispObject n, LispObject power) 4172 throws LispError4180 throws ConditionThrowable 4173 4181 { 4174 4182 if (power.zerop()) { … … 4216 4224 // ### list 4217 4225 private static final Primitive LIST = new Primitive("list") { 4218 public LispObject execute(LispObject arg) throws LispError4226 public LispObject execute(LispObject arg) throws ConditionThrowable 4219 4227 { 4220 4228 return new Cons(arg); 4221 4229 } 4222 4230 public LispObject execute(LispObject first, LispObject second) 4223 throws LispError4231 throws ConditionThrowable 4224 4232 { 4225 4233 return new Cons(first, new Cons(second)); 4226 4234 } 4227 4235 public LispObject execute(LispObject first, LispObject second, 4228 LispObject third) throws LispError4236 LispObject third) throws ConditionThrowable 4229 4237 { 4230 4238 return new Cons(first, new Cons(second, new Cons(third))); 4231 4239 } 4232 public LispObject execute(LispObject[] args) throws LispError4240 public LispObject execute(LispObject[] args) throws ConditionThrowable 4233 4241 { 4234 4242 LispObject result = NIL; … … 4241 4249 // ### list* 4242 4250 private static final Primitive LIST_ = new Primitive("list*") { 4243 public LispObject execute() throws LispError4244 { 4245 throw new WrongNumberOfArgumentsException("LIST*");4246 } 4247 public LispObject execute(LispObject arg) throws LispError4251 public LispObject execute() throws ConditionThrowable 4252 { 4253 throw new ConditionThrowable(new WrongNumberOfArgumentsException("LIST*")); 4254 } 4255 public LispObject execute(LispObject arg) throws ConditionThrowable 4248 4256 { 4249 4257 return arg; 4250 4258 } 4251 4259 public LispObject execute(LispObject first, LispObject second) 4252 throws LispError4260 throws ConditionThrowable 4253 4261 { 4254 4262 return new Cons(first, second); 4255 4263 } 4256 4264 public LispObject execute(LispObject first, LispObject second, 4257 LispObject third) throws LispError4265 LispObject third) throws ConditionThrowable 4258 4266 { 4259 4267 return new Cons(first, new Cons(second, third)); 4260 4268 } 4261 public LispObject execute(LispObject[] args) throws LispError4269 public LispObject execute(LispObject[] args) throws ConditionThrowable 4262 4270 { 4263 4271 int i = args.length - 1; … … 4271 4279 // ### nreverse 4272 4280 private static final Primitive1 NREVERSE = new Primitive1("nreverse") { 4273 public LispObject execute (LispObject arg) throws LispError{4281 public LispObject execute (LispObject arg) throws ConditionThrowable { 4274 4282 if (arg instanceof AbstractVector) { 4275 4283 ((AbstractVector)arg).nreverse(); … … 4306 4314 private static final Primitive2 NRECONC = new Primitive2("nreconc") { 4307 4315 public LispObject execute(LispObject list, LispObject obj) 4308 throws LispError4316 throws ConditionThrowable 4309 4317 { 4310 4318 if (list instanceof Cons) { … … 4338 4346 // ### reverse 4339 4347 private static final Primitive1 REVERSE = new Primitive1("reverse") { 4340 public LispObject execute(LispObject arg) throws LispError4348 public LispObject execute(LispObject arg) throws ConditionThrowable 4341 4349 { 4342 4350 if (arg instanceof AbstractVector) … … 4360 4368 private static final Primitive3 _SETELT = new Primitive3("%setelt") { 4361 4369 public LispObject execute(LispObject first, LispObject second, 4362 LispObject third) throws LispError4370 LispObject third) throws ConditionThrowable 4363 4371 { 4364 4372 if (first instanceof Cons) { … … 4433 4441 private static final Primitive2 MEMQ = new Primitive2("memq") { 4434 4442 public LispObject execute(LispObject item, LispObject list) 4435 throws LispError4443 throws ConditionThrowable 4436 4444 { 4437 4445 LispObject tail = checkList(list); … … 4451 4459 { 4452 4460 if (args.length != 5) 4453 throw new WrongNumberOfArgumentsException(this);4461 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 4454 4462 LispObject item = args[0]; 4455 4463 LispObject tail = checkList(args[1]); … … 4589 4597 // ### complex 4590 4598 private static final Primitive2 COMPLEX = new Primitive2("complex") { 4591 public LispObject execute(LispObject arg) throws LispError4599 public LispObject execute(LispObject arg) throws ConditionThrowable 4592 4600 { 4593 4601 if (arg instanceof LispFloat) … … 4598 4606 } 4599 4607 public LispObject execute(LispObject first, LispObject second) 4600 throws LispError4608 throws ConditionThrowable 4601 4609 { 4602 4610 return Complex.getInsta