Changeset 12809


Ignore:
Timestamp:
07/17/10 10:26:26 (11 years ago)
Author:
Mark Evenson
Message:

Honor *PRINT-READABLY* by throwing PRINT-NOT-READABLE for "#<".

Previously, if *PRINT-READABLY* was non-NIL, a string containing "#<"
would be output without signalling a PRINT-NOT-READABLE condition as
required by ANSI.

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

Legend:

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

    r12576 r12809  
    891891            else
    892892                out = second;
    893             checkStream(out)._writeString(first.writeToString());
     893            String output = first.writeToString();
     894            if (Symbol.PRINT_READABLY.symbolValue(LispThread.currentThread()) != NIL
     895                && output.contains("#<")) {
     896                LispObject args = NIL;
     897                args = args.push(first);
     898                args = args.push(Keyword.OBJECT);
     899                args = args.nreverse();
     900                return error(new PrintNotReadable(args));
     901            }
     902            checkStream(out)._writeString(output);
    894903            return first;
    895904        }
  • trunk/abcl/src/org/armedbear/lisp/print.lisp

    r12390 r12809  
    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))
    283287  (if *print-pretty*
    284288      (xp::output-pretty-object object stream)
Note: See TracChangeset for help on using the changeset viewer.