Changeset 13446


Ignore:
Timestamp:
08/06/11 16:59:33 (10 years ago)
Author:
ehuelsmann
Message:

Fix #158: Print "#<abc>" fails with *PRINT-READABLY* non-NIL.

Note: This commit also fixes some failures in the random testing

ANSI tests, notably PRINT.RANDOM.SYMBOL.*.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

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

    r13445 r13446  
    782782  public final String unreadableString(String s, boolean identity)
    783783  {
     784    if (Symbol.PRINT_READABLY.symbolValue() != NIL) {
     785        error(new PrintNotReadable(list(Keyword.OBJECT, this)));
     786        return null; // not reached
     787    }
    784788    StringBuilder sb = new StringBuilder("#<");
    785789    sb.append(s);
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r13440 r13446  
    909909                out = second;
    910910            String output = first.printObject();
    911             if (Symbol.PRINT_READABLY.symbolValue(LispThread.currentThread()) != NIL
    912                 && output.contains("#<")) {
    913                 //### Ticket #160: the cause lies here.
    914                 // You can't just go scan the content of the printed string,
    915                 // because the marker being sought may be part of the readable
    916                 // presentation
    917                 LispObject args = NIL;
    918                 args = args.push(first);
    919                 args = args.push(Keyword.OBJECT);
    920                 args = args.nreverse();
    921                 return error(new PrintNotReadable(args));
    922             }
    923911            checkStream(out)._writeString(output);
    924912            return first;
  • trunk/abcl/src/org/armedbear/lisp/print.lisp

    r12809 r13446  
    281281
    282282(defun %print-object (object stream)
    283   (when (and *print-readably*
    284              (typep object 'string)
    285              (search "#<" object))
    286     (error 'print-not-readable :object object))
    287283  (if *print-pretty*
    288284      (xp::output-pretty-object object stream)
Note: See TracChangeset for help on using the changeset viewer.