Changeset 3912


Ignore:
Timestamp:
09/20/03 00:12:37 (20 years ago)
Author:
piso
Message:

HANDLER-CASE: support :NO-ERROR clause.

File:
1 edited

Legend:

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

    r3910 r3912  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.415 2003-09-19 23:56:10 piso Exp $
     5 * $Id: Primitives.java,v 1.416 2003-09-20 00:12:37 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    17461746    // ### handler-case
    17471747    private static final SpecialOperator HANDLER_CASE =
    1748         new SpecialOperator("handler-case") {
     1748        new SpecialOperator("handler-case")
     1749    {
    17491750        public LispObject execute(LispObject args, Environment env)
    17501751            throws ConditionThrowable
     
    17541755            final LispThread thread = LispThread.currentThread();
    17551756            final int depth = thread.getStackDepth();
     1757            LispObject result;
    17561758            try {
    1757                 return eval(form, env, thread);
     1759                result = eval(form, env, thread);
    17581760            }
    17591761            catch (ConditionThrowable c) {
     
    17831785                throw c;
    17841786            }
     1787            // No error.
     1788            while (clauses != NIL) {
     1789                Cons clause = checkCons(clauses.car());
     1790                if (clause.car() == Keyword.NO_ERROR) {
     1791                    Closure closure = new Closure(clause.cadr(), clause.cddr(),
     1792                                                  env);
     1793                    if (thread.getValues() != null)
     1794                        result = closure.execute(thread.getValues());
     1795                    else
     1796                        result = closure.execute(result);
     1797                    break;
     1798                }
     1799                clauses = clauses.cdr();
     1800            }
     1801            return result;
    17851802        }
    17861803    };
Note: See TracChangeset for help on using the changeset viewer.