Changeset 5113


Ignore:
Timestamp:
12/13/03 00:28:08 (18 years ago)
Author:
piso
Message:

signal()

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

Legend:

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

    r4726 r5113  
    7373    public final int getDimension(int n) throws ConditionThrowable
    7474    {
    75         if (n != 0)
    76             throw new ConditionThrowable(new TypeError("bad dimension for vector"));
     75        if (n != 0) {
     76            signal(new TypeError("bad dimension for vector"));
     77            // Not reached.
     78            return 0;
     79        }
    7780        return capacity();
    7881    }
     
    123126            sb.append(')');
    124127        }
    125         throw new ConditionThrowable(new TypeError(sb.toString()));
     128        signal(new TypeError(sb.toString()));
    126129    }
    127130
     
    148151                sb.append(capacity());
    149152                sb.append(")");
    150                 throw new ConditionThrowable(new LispError(sb.toString()));
    151             }
    152             if (n < 0) {
     153                signal(new LispError(sb.toString()));
     154            } else if (n < 0) {
    153155                StringBuffer sb = new StringBuffer("the new fill pointer (");
    154156                sb.append(n);
    155157                sb.append(") is negative");
    156                 throw new ConditionThrowable(new LispError(sb.toString()));
    157             }
    158             fillPointer = n;
     158                signal(new LispError(sb.toString()));
     159            } else
     160                fillPointer = n;
    159161        }
    160162    }
  • trunk/j/src/org/armedbear/lisp/Extensions.java

    r4908 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Extensions.java,v 1.18 2003-11-28 21:01:58 piso Exp $
     5 * $Id: Extensions.java,v 1.19 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    8888            if (arg instanceof CharacterOutputStream)
    8989                return new Fixnum(((CharacterOutputStream)arg).getCharPos());
    90             throw new ConditionThrowable(new TypeError(arg, "character output stream"));
     90            return signal(new TypeError(arg, "character output stream"));
    9191        }
    9292    };
     
    104104                return second;
    105105            }
    106             throw new ConditionThrowable(new TypeError(first, "character output stream"));
     106            return signal(new TypeError(first, "character output stream"));
    107107        }
    108108    };
     
    126126            }
    127127            catch (Exception e) {
    128                 throw new ConditionThrowable(new LispError(e.getMessage()));
     128                return signal(new LispError(e.getMessage()));
    129129            }
    130130        }
     
    149149            }
    150150            catch (Exception e) {
    151                 throw new ConditionThrowable(new LispError(e.getMessage()));
     151                return signal(new LispError(e.getMessage()));
    152152            }
    153153        }
  • trunk/j/src/org/armedbear/lisp/Fixnum.java

    r4790 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Fixnum.java,v 1.78 2003-11-16 18:29:19 piso Exp $
     5 * $Id: Fixnum.java,v 1.79 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    191191        }
    192192        catch (ClassCastException e) {
    193             throw new ConditionThrowable(new TypeError(obj, "fixnum"));
     193            signal(new TypeError(obj, "fixnum"));
     194            // Not reached.
     195            return 0;
    194196        }
    195197    }
     
    201203        }
    202204        catch (ClassCastException e) {
    203             throw new ConditionThrowable(new TypeError(obj, "fixnum"));
     205            signal(new TypeError(obj, "fixnum"));
     206            // Not reached.
     207            return 0;
    204208        }
    205209    }
     
    211215        }
    212216        catch (ClassCastException e) {
    213             throw new ConditionThrowable(new TypeError(obj, "fixnum"));
     217            signal(new TypeError(obj, "fixnum"));
     218            // Not reached.
     219            return null;
    214220        }
    215221    }
     
    221227        }
    222228        catch (ClassCastException e) {
    223             throw new ConditionThrowable(new TypeError(obj, "fixnum"));
     229            signal(new TypeError(obj, "fixnum"));
     230            return 0;
    224231        }
    225232    }
     
    268275            return Complex.getInstance(add(c.getRealPart()), c.getImaginaryPart());
    269276        }
    270         throw new ConditionThrowable(new TypeError(obj, "number"));
     277        return signal(new TypeError(obj, "number"));
    271278    }
    272279
     
    291298                                       ZERO.subtract(c.getImaginaryPart()));
    292299        }
    293         throw new ConditionThrowable(new TypeError(obj, "number"));
     300        return signal(new TypeError(obj, "number"));
    294301    }
    295302
     
    314321                                       multiplyBy(c.getImaginaryPart()));
    315322        }
    316         throw new ConditionThrowable(new TypeError(obj, "number"));
     323        return signal(new TypeError(obj, "number"));
    317324    }
    318325
     
    346353                                           Fixnum.ZERO.subtract(multiplyBy(imagPart).divideBy(denominator)));
    347354            }
    348             throw new ConditionThrowable(new TypeError(obj, "number"));
     355            return signal(new TypeError(obj, "number"));
    349356        }
    350357        catch (ArithmeticException e) {
    351358            if (obj.zerop())
    352                 throw new ConditionThrowable(new DivisionByZero());
    353             throw new ConditionThrowable(new ArithmeticError(e.getMessage()));
     359                return signal(new DivisionByZero());
     360            return signal(new ArithmeticError(e.getMessage()));
    354361        }
    355362    }
     
    365372        if (obj.numberp())
    366373            return false;
    367         throw new ConditionThrowable(new TypeError(obj, "number"));
     374        signal(new TypeError(obj, "number"));
     375        // Not reached.
     376        return false;
    368377    }
    369378
     
    379388        if (obj.numberp())
    380389            return true;
    381         throw new ConditionThrowable(new TypeError(obj, "number"));
     390        signal(new TypeError(obj, "number"));
     391        // Not reached.
     392        return false;
    382393    }
    383394
     
    395406        if (obj instanceof LispFloat)
    396407            return (float) value < LispFloat.getValue(obj);
    397         throw new ConditionThrowable(new TypeError(obj, "number"));
     408        signal(new TypeError(obj, "number"));
     409        // Not reached.
     410        return false;
    398411    }
    399412
     
    411424        if (obj instanceof LispFloat)
    412425            return (float) value > LispFloat.getValue(obj);
    413         throw new ConditionThrowable(new TypeError(obj, "number"));
     426        signal(new TypeError(obj, "number"));
     427        // Not reached.
     428        return false;
    414429    }
    415430
     
    427442        if (obj instanceof LispFloat)
    428443            return (float) value <= LispFloat.getValue(obj);
    429         throw new ConditionThrowable(new TypeError(obj, "number"));
     444        signal(new TypeError(obj, "number"));
     445        // Not reached.
     446        return false;
    430447    }
    431448
     
    443460        if (obj instanceof LispFloat)
    444461            return (float) value >= LispFloat.getValue(obj);
    445         throw new ConditionThrowable(new TypeError(obj, "number"));
     462        signal(new TypeError(obj, "number"));
     463        // Not reached.
     464        return false;
    446465    }
    447466
     
    451470        final LispObject value1, value2;
    452471  try {
    453     if (obj instanceof Fixnum) {
    454             long divisor = ((Fixnum)obj).value;
    455             long quotient = value / divisor;
    456             long remainder = value % divisor;
    457             value1 = number(quotient);
    458             value2 = remainder == 0 ? Fixnum.ZERO : number(remainder);
    459     } else if (obj instanceof Bignum) {
    460             BigInteger value = getBigInteger();
    461             BigInteger divisor = ((Bignum)obj).getValue();
    462             BigInteger[] results = value.divideAndRemainder(divisor);
    463             BigInteger quotient = results[0];
    464             BigInteger remainder = results[1];
    465             value1 = number(quotient);
    466             value2 = (remainder.signum() == 0) ? Fixnum.ZERO : number(remainder);
    467     } else if (obj instanceof Ratio) {
    468             Ratio divisor = (Ratio) obj;
    469             LispObject quotient =
    470         multiplyBy(divisor.DENOMINATOR()).truncate(divisor.NUMERATOR());
    471             LispObject remainder =
    472         subtract(quotient.multiplyBy(divisor));
    473             value1 = quotient;
    474             value2 = remainder;
    475     } else
    476             throw new ConditionThrowable(new LispError("Fixnum.truncate(): not implemented: " + obj.typeOf()));
     472            if (obj instanceof Fixnum) {
     473                long divisor = ((Fixnum)obj).value;
     474                long quotient = value / divisor;
     475                long remainder = value % divisor;
     476                value1 = number(quotient);
     477                value2 = remainder == 0 ? Fixnum.ZERO : number(remainder);
     478            } else if (obj instanceof Bignum) {
     479                BigInteger value = getBigInteger();
     480                BigInteger divisor = ((Bignum)obj).getValue();
     481                BigInteger[] results = value.divideAndRemainder(divisor);
     482                BigInteger quotient = results[0];
     483                BigInteger remainder = results[1];
     484                value1 = number(quotient);
     485                value2 = (remainder.signum() == 0) ? Fixnum.ZERO : number(remainder);
     486            } else if (obj instanceof Ratio) {
     487                Ratio divisor = (Ratio) obj;
     488                LispObject quotient =
     489                    multiplyBy(divisor.DENOMINATOR()).truncate(divisor.NUMERATOR());
     490                LispObject remainder =
     491                    subtract(quotient.multiplyBy(divisor));
     492                value1 = quotient;
     493                value2 = remainder;
     494            } else
     495                return signal(new LispError("Fixnum.truncate(): not implemented: " + obj.typeOf()));
    477496        }
    478497        catch (ArithmeticException e) {
    479498            if (obj.zerop())
    480                 throw new ConditionThrowable(new DivisionByZero());
    481             throw new ConditionThrowable(new ArithmeticError(e.getMessage()));
     499                return signal(new DivisionByZero());
     500            else
     501                return signal(new ArithmeticError(e.getMessage()));
    482502        }
    483503        return thread.setValues(value1, value2);
  • trunk/j/src/org/armedbear/lisp/Function.java

    r5058 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Function.java,v 1.28 2003-12-10 21:33:35 asimon Exp $
     5 * $Id: Function.java,v 1.29 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    118118    public LispObject execute(LispObject[] args) throws ConditionThrowable
    119119    {
    120         throw new ConditionThrowable(new WrongNumberOfArgumentsException(name));
     120        return signal(new WrongNumberOfArgumentsException(name));
    121121    }
    122122
  • trunk/j/src/org/armedbear/lisp/JavaObject.java

    r5035 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: JavaObject.java,v 1.11 2003-12-09 19:04:59 dmcnaught Exp $
     5 * $Id: JavaObject.java,v 1.12 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4848        }
    4949        catch (ClassCastException e) {
    50             throw new ConditionThrowable(new TypeError(o, "Java object"));
     50            signal (new TypeError(o, "Java object"));
     51            // Not reached.
     52            return null;
    5153        }
    5254    }
     
    7072        return new Fixnum(obj.hashCode() & 0x7ffffff);
    7173    }
    72    
     74
    7375    public String toString()
    7476    {
  • trunk/j/src/org/armedbear/lisp/LispCharacter.java

    r5037 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispCharacter.java,v 1.32 2003-12-09 20:26:22 asimon Exp $
     5 * $Id: LispCharacter.java,v 1.33 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    120120        }
    121121        catch (ClassCastException e) {
    122             throw new ConditionThrowable(new TypeError(obj, "character"));
     122            signal(new TypeError(obj, "character"));
     123            // Not reached.
     124            return 0;
    123125        }
    124126    }
     
    189191                    return new LispCharacter(name.charAt(0));
    190192            }
    191             throw new ConditionThrowable(new TypeError());
     193            return signal(new TypeError());
    192194        }
    193195    };
  • trunk/j/src/org/armedbear/lisp/LispString.java

    r5037 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispString.java,v 1.70 2003-12-09 20:26:22 asimon Exp $
     5 * $Id: LispString.java,v 1.71 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    173173        if (n == array.length)
    174174            return;
    175         throw new ConditionThrowable(new LispError());
     175        signal(new LispError());
    176176    }
    177177
     
    253253        }
    254254        catch (ClassCastException e) {
    255             throw new ConditionThrowable(new TypeError(obj, "string"));
     255            signal(new TypeError(obj, "string"));
     256            // Not reached.
     257            return null;
    256258        }
    257259    }
     
    311313    public LispObject remove(LispObject item) throws ConditionThrowable
    312314    {
    313         throw new ConditionThrowable(new LispError("not implemented"));
     315        return signal(new LispError("not implemented"));
    314316    }
    315317
     
    389391                } else
    390392                    sb.append(" is negative");
    391                 throw new ConditionThrowable(new LispError(sb.toString()));
     393                return signal(new LispError(sb.toString()));
    392394            }
    393395            // Ignore elementType.
  • trunk/j/src/org/armedbear/lisp/Load.java

    r5037 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Load.java,v 1.27 2003-12-09 20:26:22 asimon Exp $
     5 * $Id: Load.java,v 1.28 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    7676        }
    7777        if (!isFile)
    78             throw new ConditionThrowable(new LispError("file not found: " + filename));
     78            return signal(new LispError("file not found: " + filename));
    7979        String truename = filename;
    8080        InputStream in = null;
     
    8484        }
    8585        catch (FileNotFoundException e) {
    86             throw new ConditionThrowable(new LispError("file not found: " + filename));
     86            return signal(new LispError("file not found: " + filename));
    8787        }
    8888        catch (IOException e) {
    89             throw new ConditionThrowable(new LispError(e.getMessage()));
     89            return signal(new LispError(e.getMessage()));
    9090        }
    9191        LispObject result =
     
    9595        }
    9696        catch (IOException e) {
    97             throw new ConditionThrowable(new LispError(e.getMessage()));
     97            return signal(new LispError(e.getMessage()));
    9898        }
    9999        return result;
     
    161161            }
    162162            catch (IOException e) {
    163                 throw new ConditionThrowable(new LispError(e.getMessage()));
     163                return signal(new LispError(e.getMessage()));
    164164            }
    165165            return result;
    166166        }
    167         throw new ConditionThrowable(new LispError("file not found: " + filename));
     167        return signal(new LispError("file not found: " + filename));
    168168    }
    169169
     
    296296        {
    297297            if (args.length == 0)
    298                 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     298                return signal(new WrongNumberOfArgumentsException(this));
    299299            // FIXME Need to support streams as well as pathname designators.
    300300            String filename;
     
    304304                filename = ((Pathname)args[0]).getNamestring();
    305305            else
    306                 throw new ConditionThrowable(new TypeError(args[0], "pathname designator"));
     306                return signal(new TypeError(args[0], "pathname designator"));
    307307            if (filename.endsWith(".compiled"))
    308308                filename = filename.substring(0, filename.length() - 9);
  • trunk/j/src/org/armedbear/lisp/Nil.java

    r4827 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Nil.java,v 1.27 2003-11-19 01:56:35 piso Exp $
     5 * $Id: Nil.java,v 1.28 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    9393    public LispObject elt(int index) throws ConditionThrowable
    9494    {
    95         throw new ConditionThrowable(new TypeError("ELT: invalid index " + index + " for " + this));
     95        return signal(new TypeError("ELT: invalid index " + index + " for " + this));
    9696    }
    9797
  • trunk/j/src/org/armedbear/lisp/Package.java

    r4791 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Package.java,v 1.48 2003-11-16 18:35:25 piso Exp $
     5 * $Id: Package.java,v 1.49 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    278278                        sb.append(" and ");
    279279                        sb.append(s.getQualifiedName());
    280                         throw new ConditionThrowable(new PackageError(sb.toString()));
     280                        return signal(new PackageError(sb.toString()));
    281281                    }
    282282                }
     
    311311            sb.append(" is already accessible in package ");
    312312            sb.append(name);
    313             throw new ConditionThrowable(new PackageError(sb.toString()));
     313            signal(new PackageError(sb.toString()));
     314            return;
    314315        }
    315316        internalSymbols.put(symbol.getName(), symbol);
     
    326327                sb.append(" is not accessible in package ");
    327328                sb.append(name);
    328                 throw new ConditionThrowable(new PackageError(sb.toString()));
     329                signal(new PackageError(sb.toString()));
     330                return;
    329331            }
    330332            if (sym != symbol) {
     
    334336                sb.append(" is already accessible in package ");
    335337                sb.append(name);
    336                 throw new ConditionThrowable(new PackageError(sb.toString()));
     338                signal(new PackageError(sb.toString()));
     339                return;
    337340            }
    338341            internalSymbols.put(symbolName, symbol);
     
    353356                            sb.append(" is already accessible in package ");
    354357                            sb.append(pkg.getName());
    355                             throw new ConditionThrowable(new LispError(sb.toString()));
     358                            signal(new LispError(sb.toString()));
     359                            return;
    356360                        }
    357361                    }
     
    371375        sb.append(" is not accessible in package ");
    372376        sb.append(name);
    373         throw new ConditionThrowable(new PackageError(sb.toString()));
     377        signal(new PackageError(sb.toString()));
    374378    }
    375379
     
    393397            sb.append(" is not accessible in package ");
    394398            sb.append(name);
    395             throw new ConditionThrowable(new PackageError(sb.toString()));
     399            signal(new PackageError(sb.toString()));
    396400        }
    397401    }
  • trunk/j/src/org/armedbear/lisp/Packages.java

    r3894 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Packages.java,v 1.11 2003-09-19 14:44:10 piso Exp $
     5 * $Id: Packages.java,v 1.12 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5353    {
    5454        final String name = pkg.getName();
    55         if (map.get(name) != null)
    56             throw new ConditionThrowable(new LispError("a package named " + name +
    57                                                        " already exists"));
     55        if (map.get(name) != null) {
     56            signal(new LispError("a package named " + name + " already exists"));
     57            return;
     58        }
    5859        packages.add(pkg);
    5960        map.put(name, pkg);
     
    7677        throws ConditionThrowable
    7778    {
    78         if (map.get(name) != null)
    79             throw new ConditionThrowable(new LispError("a package named " + name +
    80                                                        " already exists"));
     79        if (map.get(name) != null) {
     80            signal(new LispError("a package named " + name + " already exists"));
     81            // Not reached.
     82            return null;
     83        }
    8184        Package pkg = new Package(name);
    8285        packages.add(pkg);
     
    8992        throws ConditionThrowable
    9093    {
    91         if (map.get(nickname) != null)
    92             throw new ConditionThrowable(new PackageError("a package named " + nickname +
    93                                                           " already exists"));
     94        if (map.get(nickname) != null) {
     95            signal(new PackageError("a package named " + nickname + " already exists"));
     96            return;
     97        }
    9498        map.put(nickname, pkg);
    9599    }
  • trunk/j/src/org/armedbear/lisp/Primitive0.java

    r5034 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitive0.java,v 1.10 2003-12-09 15:06:17 asimon Exp $
     5 * $Id: Primitive0.java,v 1.11 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5656    public LispObject execute(LispObject first) throws ConditionThrowable
    5757    {
    58         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     58        return signal(new WrongNumberOfArgumentsException(this));
    5959    }
    6060
     
    6262        throws ConditionThrowable
    6363    {
    64         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     64        return signal(new WrongNumberOfArgumentsException(this));
    6565    }
    6666
     
    6868        LispObject third) throws ConditionThrowable
    6969    {
    70         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     70        return signal(new WrongNumberOfArgumentsException(this));
    7171    }
    7272
     
    7474    {
    7575        if (args.length != 0)
    76             throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     76            return signal(new WrongNumberOfArgumentsException(this));
    7777        return execute();
    7878    }
  • trunk/j/src/org/armedbear/lisp/Primitive1.java

    r5033 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitive1.java,v 1.10 2003-12-09 06:07:05 asimon Exp $
     5 * $Id: Primitive1.java,v 1.11 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5656    public LispObject execute() throws ConditionThrowable
    5757    {
    58         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     58        return signal(new WrongNumberOfArgumentsException(this));
    5959    }
    6060
     
    6262        throws ConditionThrowable
    6363    {
    64         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     64        return signal(new WrongNumberOfArgumentsException(this));
    6565    }
    6666
     
    6868        LispObject third) throws ConditionThrowable
    6969    {
    70         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     70        return signal(new WrongNumberOfArgumentsException(this));
    7171    }
    7272
     
    7474    {
    7575        if (args.length != 1)
    76             throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     76            return signal(new WrongNumberOfArgumentsException(this));
    7777        return execute(args[0]);
    7878    }
  • trunk/j/src/org/armedbear/lisp/Primitive2.java

    r5033 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitive2.java,v 1.9 2003-12-09 06:07:05 asimon Exp $
     5 * $Id: Primitive2.java,v 1.10 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5050    public LispObject execute() throws ConditionThrowable
    5151    {
    52         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     52        return signal(new WrongNumberOfArgumentsException(this));
    5353    }
    5454
     
    5656        throws ConditionThrowable
    5757    {
    58         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     58        return signal(new WrongNumberOfArgumentsException(this));
    5959    }
    6060
     
    6262        LispObject third) throws ConditionThrowable
    6363    {
    64         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     64        return signal(new WrongNumberOfArgumentsException(this));
    6565    }
    6666
     
    6868    {
    6969        if (args.length != 2)
    70             throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     70            return signal(new WrongNumberOfArgumentsException(this));
    7171        return execute(args[0], args[1]);
    7272    }
  • trunk/j/src/org/armedbear/lisp/Primitive3.java

    r5033 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitive3.java,v 1.10 2003-12-09 06:07:05 asimon Exp $
     5 * $Id: Primitive3.java,v 1.11 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5050    public LispObject execute() throws ConditionThrowable
    5151    {
    52         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     52        return signal(new WrongNumberOfArgumentsException(this));
    5353    }
    5454
     
    5656        throws ConditionThrowable
    5757    {
    58         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     58        return signal(new WrongNumberOfArgumentsException(this));
    5959    }
    6060
     
    6262        throws ConditionThrowable
    6363    {
    64         throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     64        return signal(new WrongNumberOfArgumentsException(this));
    6565    }
    6666
     
    6868    {
    6969        if (args.length != 3)
    70             throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     70            return signal(new WrongNumberOfArgumentsException(this));
    7171        return execute(args[0], args[1], args[2]);
    7272    }
  • trunk/j/src/org/armedbear/lisp/StringOutputStream.java

    r5037 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: StringOutputStream.java,v 1.6 2003-12-09 20:26:23 asimon Exp $
     5 * $Id: StringOutputStream.java,v 1.7 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    6161        {
    6262            if (args.length > 1)
    63                 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
     63                return signal(new WrongNumberOfArgumentsException(this));
    6464            // FIXME Ignore arg for now.
    6565            return new StringOutputStream();
     
    7575            if (arg instanceof StringOutputStream)
    7676                return ((StringOutputStream)arg).getString();
    77             throw new ConditionThrowable(new TypeError(this, "string output stream"));
     77            return signal(new TypeError(this, "string output stream"));
    7878        }
    7979    };
  • trunk/j/src/org/armedbear/lisp/Symbol.java

    r5109 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Symbol.java,v 1.98 2003-12-12 19:13:14 piso Exp $
     5 * $Id: Symbol.java,v 1.99 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    314314        if (value != null)
    315315            return value;
    316         throw new ConditionThrowable(new LispError(toString().concat(" has no dynamic value")));
     316        return signal(new LispError(toString().concat(" has no dynamic value")));
    317317    }
    318318
     
    345345    {
    346346        if (function == null)
    347             throw new ConditionThrowable(new UndefinedFunction(this));
     347            return signal(new UndefinedFunction(this));
    348348        return function;
    349349    }
     
    462462            }
    463463            catch (ClassCastException e) {
    464                 throw new ConditionThrowable(new TypeError(arg, "symbol"));
     464                return signal(new TypeError(arg, "symbol"));
    465465            }
    466466        }
     
    477477            }
    478478            catch (ClassCastException e) {
    479                 throw new ConditionThrowable(new TypeError(arg, "symbol"));
     479                return signal(new TypeError(arg, "symbol"));
    480480            }
    481481        }
     
    496496            }
    497497            // function == null or ClassCastException
    498             throw new ConditionThrowable(new TypeError(arg, "symbol"));
     498            return signal(new TypeError(arg, "symbol"));
    499499        }
    500500    };
     
    510510            }
    511511            catch (ClassCastException e) {
    512                 throw new ConditionThrowable(new TypeError(arg, "symbol"));
     512                return signal(new TypeError(arg, "symbol"));
    513513            }
    514514        }
     
    547547            }
    548548            catch (ClassCastException e) {
    549                 throw new ConditionThrowable(new TypeError(arg, "symbol"));
     549                return signal(new TypeError(arg, "symbol"));
    550550            }
    551551        }
  • trunk/j/src/org/armedbear/lisp/TypeError.java

    r5096 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: TypeError.java,v 1.13 2003-12-12 16:14:47 piso Exp $
     5 * $Id: TypeError.java,v 1.14 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    123123            if (arg instanceof TypeError)
    124124                return ((TypeError)arg).datum;
    125             throw new ConditionThrowable(new TypeError(arg, Symbol.TYPE_ERROR));
     125            return signal(new TypeError(arg, Symbol.TYPE_ERROR));
    126126        }
    127127    };
     
    135135            if (arg instanceof TypeError)
    136136                return ((TypeError)arg).expectedType;
    137             throw new ConditionThrowable(new TypeError(arg, Symbol.TYPE_ERROR));
     137            return signal(new TypeError(arg, Symbol.TYPE_ERROR));
    138138        }
    139139    };
  • trunk/j/src/org/armedbear/lisp/Utilities.java

    r4435 r5113  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Utilities.java,v 1.4 2003-10-17 17:30:50 piso Exp $
     5 * $Id: Utilities.java,v 1.5 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    8181        else if (pathspec instanceof Pathname)
    8282            namestring = ((Pathname)pathspec).getNamestring();
    83         else
    84             throw new ConditionThrowable(new TypeError(pathspec,
    85                                                        "pathname designator"));
     83        else {
     84            signal(new TypeError(pathspec, "pathname designator"));
     85            // Not reached.
     86            return null;
     87        }
    8688        if (isFilenameAbsolute(namestring)) {
    8789            if (isPlatformUnix()) {
  • trunk/j/src/org/armedbear/lisp/Vector.java

    r4726 r5113  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Vector.java,v 1.28 2003-11-14 00:52:09 piso Exp $
     5 * $Id: Vector.java,v 1.29 2003-12-13 00:28:08 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    187187        if (n == elements.length)
    188188            return;
    189         throw new ConditionThrowable(new LispError());
     189        signal(new LispError());
    190190    }
    191191
Note: See TracChangeset for help on using the changeset viewer.