Changeset 5140


Ignore:
Timestamp:
12/15/03 09:28:37 (18 years ago)
Author:
asimon
Message:

ARGLIST: better error checking

File:
1 edited

Legend:

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

    r5137 r5140  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: arglist.java,v 1.5 2003-12-15 01:40:53 asimon Exp $
     5 * $Id: arglist.java,v 1.6 2003-12-15 09:28:37 asimon Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2525{
    2626
    27   private static final Functional getFunctional(LispObject obj)
     27    private static final Functional getFunctional(LispObject obj)
    2828        throws ConditionThrowable
    2929    {
     
    3838      }
    3939            if (fun instanceof Functional) {
    40         Functional func = (Functional) fun;
    41         if (func.getArglist() != null) return  func;
    42         return getFunctional(get(checkSymbol(obj), Symbol.MACROEXPAND_MACRO, NIL));
     40                Functional func = (Functional) fun;
     41                if (func.getArglist() != null) return  func;
     42                LispObject other = get(checkSymbol(obj), Symbol.MACROEXPAND_MACRO, NIL);
     43                if (other != null)
     44                    return getFunctional(other);
     45                else
     46                    return null;
    4347      }
    4448        } else if (obj instanceof Cons && obj.car() == Symbol.LAMBDA)
    4549            return new Closure(obj.cadr(), obj.cddr(), new Environment());
    46         throw new ConditionThrowable(new UndefinedFunction(obj));
     50  return null;
    4751    }
    4852
     
    5458            LispThread thread = LispThread.currentThread();
    5559            Functional functional = getFunctional(arg);
    56             LispObject arglist = functional.getArglist();
     60      LispObject arglist = null;
     61      if (functional != null)
     62                arglist = functional.getArglist();
    5763            final LispObject value1, value2;
    5864            if (arglist instanceof LispString) {
Note: See TracChangeset for help on using the changeset viewer.