Changeset 12645


Ignore:
Timestamp:
05/01/10 20:21:50 (13 years ago)
Author:
ehuelsmann
Message:

Fix #93: Empty VALUES set in the reader treated as NIL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Stream.java

    r12604 r12645  
    658658                    _unreadChar(nextChar);
    659659                }
     660
     661                thread._values = null;
    660662                LispObject obj = processChar(c, rt);
    661663                if (obj == null) {
     
    663665                    continue;
    664666                }
    665                 if (first == null) {
    666                     first = new Cons(obj);
    667                     last = first;
    668                 } else {
    669                     Cons newCons = new Cons(obj);
    670                     last.cdr = newCons;
    671                     last = newCons;
     667
     668                if (! (obj == NIL && thread._values != null
     669                       && thread._values.length == 0)) {
     670                    // Don't add the return value NIL to the list
     671                    // if the _values array indicates no values have been returned
     672                    if (first == null) {
     673                        first = new Cons(obj);
     674                        last = first;
     675                    } else {
     676                        Cons newCons = new Cons(obj);
     677                        last.cdr = newCons;
     678                        last = newCons;
     679                    }
    672680                }
    673681            }
     
    14401448            if (c == delimiter)
    14411449                break;
     1450
     1451            thread._values = null;
    14421452            LispObject obj = processChar(c, rt);
    1443             if (obj != null)
     1453            if (obj != null &&
     1454                ! (obj == NIL && thread._values != null
     1455                   && thread._values.length == 0))
     1456                // Don't add 'obj' to the list, if _values indicates
     1457                // no values have been returned
    14441458                result = new Cons(obj, result);
    14451459        }
Note: See TracChangeset for help on using the changeset viewer.