Changeset 12810


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

PATHNAME without namestring now has a non-printable representation.

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

Legend:

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

    r12803 r12810  
    861861        }
    862862        StringBuilder sb = new StringBuilder();
     863
    863864        if (useNamestring) {
    864865            if (printReadably || printEscape) {
     
    878879                sb.append('"');
    879880            }
    880         } else {
    881             final SpecialBindingsMark mark = thread.markSpecialBindings();
    882             thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    883             try {
    884                 final boolean ANSI_COMPATIBLE = true;
    885                 final String SPACE = " ";
    886                 if (ANSI_COMPATIBLE) {
    887                     sb.append("#P(\"");
    888                 } else {
    889                     sb.append("#P(");
    890 
    891                 }
    892                 if (host != NIL) {
    893                     sb.append(":HOST ");
    894                     sb.append(host.writeToString());
    895                     sb.append(SPACE);
    896                 }
    897                 if (device != NIL) {
    898                     sb.append(":DEVICE ");
    899                     sb.append(device.writeToString());
    900                     sb.append(SPACE);
    901                 }
    902                 if (directory != NIL) {
    903                     sb.append(":DIRECTORY ");
    904                     sb.append(directory.writeToString());
    905                     sb.append(SPACE);
    906                 }
    907                 if (name != NIL) {
    908                     sb.append(":NAME ");
    909                     sb.append(name.writeToString());
    910                     sb.append(SPACE);
    911                 }
    912                 if (type != NIL) {
    913                     sb.append(":TYPE ");
    914                     sb.append(type.writeToString());
    915                     sb.append(SPACE);
    916                 }
    917                 if (version != NIL) {
    918                     sb.append(":VERSION ");
    919                     sb.append(version.writeToString());
    920                     sb.append(SPACE);
    921                 }
    922                 if (sb.charAt(sb.length() - 1) == ' ') { // XXX
    923                     sb.setLength(sb.length() - 1);
    924                 }
    925                 if (ANSI_COMPATIBLE) {
    926                     sb.append(')' + "\"");
    927                 } else {
    928                     sb.append(')');
    929                 }
    930             } finally {
    931                 thread.resetSpecialBindings(mark);
    932             }
    933         }
    934         return sb.toString();
     881            return sb.toString();
     882        }
     883
     884        sb.append("PATHNAME (with no namestring) ");
     885        if (host != NIL) {
     886            sb.append(":HOST ");
     887            sb.append(host.writeToString());
     888            sb.append(" ");
     889        }
     890        if (device != NIL) {
     891            sb.append(":DEVICE ");
     892            sb.append(device.writeToString());
     893            sb.append(" ");
     894        }
     895        if (directory != NIL) {
     896            sb.append(":DIRECTORY ");
     897            sb.append(directory.writeToString());
     898            sb.append(" ");
     899        }
     900        if (name != NIL) {
     901            sb.append(":NAME ");
     902            sb.append(name.writeToString());
     903            sb.append(" ");
     904        }
     905        if (type != NIL) {
     906            sb.append(":TYPE ");
     907            sb.append(type.writeToString());
     908            sb.append(" ");
     909        }
     910        if (version != NIL) {
     911            sb.append(":VERSION ");
     912            sb.append(version.writeToString());
     913            sb.append(" ");
     914        }
     915        if (sb.charAt(sb.length() - 1) == ' ') {
     916            sb.setLength(sb.length() - 1);
     917        }
     918
     919        return unreadableString(sb.toString());
    935920    }
    936921    // A logical host is represented as the string that names it.
  • trunk/abcl/src/org/armedbear/lisp/Stream.java

    r12766 r12810  
    535535        LispObject obj = read(true, NIL, false,
    536536                              LispThread.currentThread(), rta);
    537         if (obj instanceof AbstractString)
     537        if (obj instanceof AbstractString) {
    538538            return Pathname.parseNamestring((AbstractString)obj);
     539        }
    539540        if (obj.listp())
    540541            return Pathname.makePathname(obj);
    541         return error(new TypeError("#p requires a string or list argument."));
     542        return error(new TypeError("#p requires a string argument."));
    542543    }
    543544
Note: See TracChangeset for help on using the changeset viewer.