Changeset 3886


Ignore:
Timestamp:
09/19/03 12:20:34 (19 years ago)
Author:
piso
Message:

Conditions: work in progress.

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

Legend:

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

    r3883 r3886  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: CharacterInputStream.java,v 1.47 2003-09-19 01:46:40 piso Exp $
     5 * $Id: CharacterInputStream.java,v 1.48 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    630630            Package pkg = Packages.findPackage(packageName);
    631631            if (pkg == null)
    632                 throw new PackageError("package \"" + packageName +
    633                     "\" not found");
     632                throw new ConditionThrowable(new PackageError("package \"" + packageName +
     633                                                              "\" not found"));
    634634            Symbol symbol = pkg.findExternalSymbol(symbolName);
    635635            if (symbol != null)
  • trunk/j/src/org/armedbear/lisp/Lisp.java

    r3885 r3886  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Lisp.java,v 1.136 2003-09-19 12:10:27 piso Exp $
     5 * $Id: Lisp.java,v 1.137 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    771771        if (pkg != null)
    772772            return pkg;
    773         throw new PackageError(obj + " is not the name of a package");
     773        throw new ConditionThrowable(new PackageError(obj + " is not the name of a package"));
    774774    }
    775775
  • trunk/j/src/org/armedbear/lisp/Package.java

    r3883 r3886  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Package.java,v 1.44 2003-09-19 01:46:42 piso Exp $
     5 * $Id: Package.java,v 1.45 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    285285    }
    286286
    287     public synchronized LispObject unintern(Symbol symbol) throws PackageError
     287    public synchronized LispObject unintern(Symbol symbol) throws ConditionThrowable
    288288    {
    289289        final String symbolName = symbol.getName();
     
    311311                        sb.append(" and ");
    312312                        sb.append(s.getQualifiedName());
    313                         throw new PackageError(sb.toString());
     313                        throw new ConditionThrowable(new PackageError(sb.toString()));
    314314                    }
    315315                }
     
    344344            sb.append(" is already accessible in package ");
    345345            sb.append(name);
    346             throw new PackageError(sb.toString());
     346            throw new ConditionThrowable(new PackageError(sb.toString()));
    347347        }
    348348        internalSymbols.put(symbol.getName(), symbol);
     
    359359                sb.append(" is not accessible in package ");
    360360                sb.append(name);
    361                 throw new PackageError(sb.toString());
     361                throw new ConditionThrowable(new PackageError(sb.toString()));
    362362            }
    363363            if (sym != symbol) {
     
    367367                sb.append(" is already accessible in package ");
    368368                sb.append(name);
    369                 throw new PackageError(sb.toString());
     369                throw new ConditionThrowable(new PackageError(sb.toString()));
    370370            }
    371371            internalSymbols.put(symbolName, symbol);
     
    404404        sb.append(" is not accessible in package ");
    405405        sb.append(name);
    406         throw new PackageError(sb.toString());
     406        throw new ConditionThrowable(new PackageError(sb.toString()));
    407407    }
    408408
     
    426426            sb.append(" is not accessible in package ");
    427427            sb.append(name);
    428             throw new PackageError(sb.toString());
     428            throw new ConditionThrowable(new PackageError(sb.toString()));
    429429        }
    430430    }
  • trunk/j/src/org/armedbear/lisp/PackageError.java

    r1934 r3886  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: PackageError.java,v 1.1 2003-05-24 15:06:46 piso Exp $
     5 * $Id: PackageError.java,v 1.2 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2222package org.armedbear.lisp;
    2323
    24 public class PackageError extends LispError
     24public class PackageError extends Condition
    2525{
     26    private String message;
     27
    2628    public PackageError()
    2729    {
    28         super();
    2930    }
    3031
    3132    public PackageError(String message)
    3233    {
    33         super(message);
     34        this.message = message;
     35    }
     36
     37    public LispObject typep(LispObject type) throws ConditionThrowable
     38    {
     39        if (type == Symbol.PACKAGE_ERROR)
     40            return T;
     41        if (type == Symbol.ERROR)
     42            return T;
     43        return super.typep(type);
    3444    }
    3545}
  • trunk/j/src/org/armedbear/lisp/PackageFunctions.java

    r3883 r3886  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: PackageFunctions.java,v 1.17 2003-09-19 01:46:42 piso Exp $
     5 * $Id: PackageFunctions.java,v 1.18 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    256256                    String nick = javaString(list.car());
    257257                    if (Packages.findPackage(nick) != null) {
    258                         throw new PackageError("a package named " + nick +
    259                                             " already exists");
     258                        throw new ConditionThrowable(new PackageError("a package named " + nick +
     259                                                                      " already exists"));
    260260                    }
    261261                    list = list.cdr();
  • trunk/j/src/org/armedbear/lisp/Packages.java

    r3883 r3886  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Packages.java,v 1.9 2003-09-19 01:46:42 piso Exp $
     5 * $Id: Packages.java,v 1.10 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    9090    {
    9191        if (map.get(nickname) != null)
    92             throw new PackageError("a package named " + nickname +
    93                                    " already exists");
     92            throw new ConditionThrowable(new PackageError("a package named " + nickname +
     93                                                          " already exists"));
    9494        map.put(nickname, pkg);
    9595    }
  • trunk/j/src/org/armedbear/lisp/Primitives.java

    r3885 r3886  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.407 2003-09-19 12:10:27 piso Exp $
     5 * $Id: Primitives.java,v 1.408 2003-09-19 12:20:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    11501150            if (datum instanceof Symbol) {
    11511151                if (datum == Symbol.PACKAGE_ERROR)
    1152                     throw new PackageError(_format(args, 1));
     1152                    throw new ConditionThrowable(new PackageError(_format(args, 1)));
    11531153                if (datum == Symbol.PARSE_ERROR)
    11541154                    throw new ConditionThrowable(new ParseError(_format(args, 1)));
     
    17981798            return c.getCondition() instanceof TypeError;
    17991799        if (type == Symbol.PACKAGE_ERROR)
    1800             return c instanceof PackageError;
     1800            return c.getCondition() instanceof PackageError;
    18011801        if (type == Symbol.PARSE_ERROR)
    18021802            return c.getCondition() instanceof ParseError;
     
    26292629                    String nick = javaString(list.car());
    26302630                    if (Packages.findPackage(nick) != null) {
    2631                         throw new PackageError("a package named " + nick +
    2632                                                " already exists");
     2631                        throw new ConditionThrowable(new PackageError("a package named " + nick +
     2632                                                                      " already exists"));
    26332633                    }
    26342634                    list = list.cdr();
     
    26872687            Package pkg = Packages.findPackage(packageName);
    26882688            if (pkg == null)
    2689                 throw new PackageError("package " + arg + " does not exist");
     2689                throw new ConditionThrowable(new PackageError("package " + arg + " does not exist"));
    26902690            LispThread thread = LispThread.currentThread();
    26912691            Environment dynEnv = thread.getDynamicEnvironment();
Note: See TracChangeset for help on using the changeset viewer.