[armedbear-cvs] r13440 - trunk/abcl/src/org/armedbear/lisp

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Fri Aug 5 21:25:12 UTC 2011


Author: ehuelsmann
Date: Fri Aug  5 14:25:10 2011
New Revision: 13440

Log:
Rename writeToString() to printObject() since that's what it's being used for.
Additionally, create princToString() for use in error messages, making the
  required replacement where appropriate.

Modified:
   trunk/abcl/src/org/armedbear/lisp/AbstractArray.java
   trunk/abcl/src/org/armedbear/lisp/AbstractBitVector.java
   trunk/abcl/src/org/armedbear/lisp/AbstractString.java
   trunk/abcl/src/org/armedbear/lisp/AbstractVector.java
   trunk/abcl/src/org/armedbear/lisp/Autoload.java
   trunk/abcl/src/org/armedbear/lisp/AutoloadMacro.java
   trunk/abcl/src/org/armedbear/lisp/Bignum.java
   trunk/abcl/src/org/armedbear/lisp/BroadcastStream.java
   trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java
   trunk/abcl/src/org/armedbear/lisp/CaseFrobStream.java
   trunk/abcl/src/org/armedbear/lisp/CellError.java
   trunk/abcl/src/org/armedbear/lisp/Closure.java
   trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java
   trunk/abcl/src/org/armedbear/lisp/Complex.java
   trunk/abcl/src/org/armedbear/lisp/ComplexArray.java
   trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte32.java
   trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte8.java
   trunk/abcl/src/org/armedbear/lisp/Condition.java
   trunk/abcl/src/org/armedbear/lisp/Cons.java
   trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java
   trunk/abcl/src/org/armedbear/lisp/Environment.java
   trunk/abcl/src/org/armedbear/lisp/FileStream.java
   trunk/abcl/src/org/armedbear/lisp/Fixnum.java
   trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java
   trunk/abcl/src/org/armedbear/lisp/ForwardReferencedClass.java
   trunk/abcl/src/org/armedbear/lisp/Function.java
   trunk/abcl/src/org/armedbear/lisp/Go.java
   trunk/abcl/src/org/armedbear/lisp/HashTable.java
   trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java
   trunk/abcl/src/org/armedbear/lisp/Interpreter.java
   trunk/abcl/src/org/armedbear/lisp/JarStream.java
   trunk/abcl/src/org/armedbear/lisp/Java.java
   trunk/abcl/src/org/armedbear/lisp/JavaObject.java
   trunk/abcl/src/org/armedbear/lisp/JavaStackFrame.java
   trunk/abcl/src/org/armedbear/lisp/Layout.java
   trunk/abcl/src/org/armedbear/lisp/Lisp.java
   trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
   trunk/abcl/src/org/armedbear/lisp/LispClass.java
   trunk/abcl/src/org/armedbear/lisp/LispObject.java
   trunk/abcl/src/org/armedbear/lisp/LispStackFrame.java
   trunk/abcl/src/org/armedbear/lisp/LispThread.java
   trunk/abcl/src/org/armedbear/lisp/Load.java
   trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java
   trunk/abcl/src/org/armedbear/lisp/MacroObject.java
   trunk/abcl/src/org/armedbear/lisp/MathFunctions.java
   trunk/abcl/src/org/armedbear/lisp/Package.java
   trunk/abcl/src/org/armedbear/lisp/PackageFunctions.java
   trunk/abcl/src/org/armedbear/lisp/Pathname.java
   trunk/abcl/src/org/armedbear/lisp/Primitives.java
   trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java
   trunk/abcl/src/org/armedbear/lisp/RandomState.java
   trunk/abcl/src/org/armedbear/lisp/Ratio.java
   trunk/abcl/src/org/armedbear/lisp/Readtable.java
   trunk/abcl/src/org/armedbear/lisp/Return.java
   trunk/abcl/src/org/armedbear/lisp/ShellCommand.java
   trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java
   trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte16.java
   trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte32.java
   trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte8.java
   trunk/abcl/src/org/armedbear/lisp/SingleFloat.java
   trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java
   trunk/abcl/src/org/armedbear/lisp/SpecialOperator.java
   trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java
   trunk/abcl/src/org/armedbear/lisp/StandardClass.java
   trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java
   trunk/abcl/src/org/armedbear/lisp/StandardMethod.java
   trunk/abcl/src/org/armedbear/lisp/StandardObject.java
   trunk/abcl/src/org/armedbear/lisp/StandardObjectFunctions.java
   trunk/abcl/src/org/armedbear/lisp/Stream.java
   trunk/abcl/src/org/armedbear/lisp/StructureClass.java
   trunk/abcl/src/org/armedbear/lisp/StructureObject.java
   trunk/abcl/src/org/armedbear/lisp/Symbol.java
   trunk/abcl/src/org/armedbear/lisp/SynonymStream.java
   trunk/abcl/src/org/armedbear/lisp/Throw.java
   trunk/abcl/src/org/armedbear/lisp/TwoWayStream.java
   trunk/abcl/src/org/armedbear/lisp/TypeError.java
   trunk/abcl/src/org/armedbear/lisp/URLStream.java
   trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java
   trunk/abcl/src/org/armedbear/lisp/UnboundVariable.java
   trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java
   trunk/abcl/src/org/armedbear/lisp/Utilities.java
   trunk/abcl/src/org/armedbear/lisp/WeakHashTable.java
   trunk/abcl/src/org/armedbear/lisp/WeakReference.java
   trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java
   trunk/abcl/src/org/armedbear/lisp/ZeroRankArray.java
   trunk/abcl/src/org/armedbear/lisp/delete_file.java
   trunk/abcl/src/org/armedbear/lisp/jclass_name.java
   trunk/abcl/src/org/armedbear/lisp/jmethod_return_type.java
   trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp
   trunk/abcl/src/org/armedbear/lisp/zip.java

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractArray.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractArray.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractArray.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -160,7 +160,7 @@
                 // ### i18n
                 final String errorMsg =
                     "Invalid index %d for array %s.";
-                error(new ProgramError(String.format(errorMsg, n, writeToString())));
+                error(new ProgramError(String.format(errorMsg, n, printObject())));
             }
             sum += n * lastSize;
         }
@@ -218,7 +218,7 @@
         sb.append('(');
         if (this instanceof SimpleArray_T)
             sb.append("SIMPLE-");
-        sb.append("ARRAY " + getElementType().writeToString() + " (");
+        sb.append("ARRAY " + getElementType().printObject() + " (");
         for (int i = 0; i < dimv.length; i++) {
             sb.append(dimv[i]);
             if (i < dimv.length - 1)
@@ -228,7 +228,7 @@
         return unreadableString(sb.toString());
     }
 
-    // Helper for writeToString().
+    // Helper for printObject().
     private void appendContents(int[] dimensions, int index, StringBuilder sb,
                                 LispThread thread)
 
@@ -240,7 +240,7 @@
                                AREF(index), stream);
                 sb.append(stream.getString().getStringValue());
             } else
-                sb.append(AREF(index).writeToString());
+                sb.append(AREF(index).printObject());
         } else {
             final LispObject printReadably =
                 Symbol.PRINT_READABLY.symbolValue(thread);

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractBitVector.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractBitVector.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractBitVector.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -172,7 +172,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         final LispThread thread = LispThread.currentThread();
         final int length = length();

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractString.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractString.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractString.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -110,7 +110,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return writeToString(0, length());
     }

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractVector.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractVector.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractVector.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -154,7 +154,7 @@
     StringBuilder sb = new StringBuilder("Invalid array index ");
     sb.append(index);
     sb.append(" for ");
-    sb.append(writeToString());
+    sb.append(princToString());
     if (limit > 0)
       {
         sb.append(" (should be >= 0 and < ");
@@ -204,7 +204,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     if (Symbol.PRINT_READABLY.symbolValue(thread) != NIL)
@@ -215,7 +215,7 @@
           {
             if (i > 0)
               sb.append(' ');
-            sb.append(AREF(i).writeToString());
+            sb.append(AREF(i).printObject());
           }
         sb.append(')');
         return sb.toString();
@@ -248,7 +248,7 @@
                   {
                     if (i > 0)
                       sb.append(' ');
-                    sb.append(AREF(i).writeToString());
+                    sb.append(AREF(i).printObject());
                   }
               }
             finally

Modified: trunk/abcl/src/org/armedbear/lisp/Autoload.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Autoload.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Autoload.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -153,7 +153,7 @@
         if (debug) {
             if (symbol != null) {
                 if (symbol.getSymbolFunction() instanceof Autoload) {
-                    Debug.trace("Unable to autoload " + symbol.writeToString());
+                    Debug.trace("Unable to autoload " + symbol.princToString());
                     throw new IntegrityError();
                 }
             }
@@ -259,10 +259,10 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer("#<AUTOLOAD ");
-        sb.append(symbol.writeToString());
+        sb.append(symbol.princToString());
         sb.append(" \"");
         if (className != null) {
             int index = className.lastIndexOf('.');

Modified: trunk/abcl/src/org/armedbear/lisp/AutoloadMacro.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AutoloadMacro.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/AutoloadMacro.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -64,10 +64,10 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer("#<AUTOLOAD-MACRO ");
-        sb.append(getSymbol().writeToString());
+        sb.append(getSymbol().princToString());
         sb.append(" \"");
         sb.append(getFileName());
         sb.append("\">");

Modified: trunk/abcl/src/org/armedbear/lisp/Bignum.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Bignum.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Bignum.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -289,7 +289,7 @@
   {
     float f = value.floatValue();
     if (Float.isInfinite(f))
-      error(new TypeError("The value " + writeToString() +
+      error(new TypeError("The value " + princToString() +
                            " is too large to be converted to a single float."));
     return f;
   }
@@ -299,7 +299,7 @@
   {
     double d = value.doubleValue();
     if (Double.isInfinite(d))
-      error(new TypeError("The value " + writeToString() +
+      error(new TypeError("The value " + princToString() +
                            " is too large to be converted to a double float."));
     return d;
   }
@@ -755,7 +755,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     final int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));

Modified: trunk/abcl/src/org/armedbear/lisp/BroadcastStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/BroadcastStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/BroadcastStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -219,7 +219,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return unreadableString("BROADCAST-STREAM");
     }

Modified: trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -73,14 +73,14 @@
   @Override
   public LispObject getDescription()
   {
-    return new SimpleString(writeToString());
+    return new SimpleString(princToString());
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     StringBuilder sb = new StringBuilder("#<BUILT-IN-CLASS ");
-    sb.append(getName().writeToString());
+    sb.append(getName().printObject());
     sb.append('>');
     return sb.toString();
   }

Modified: trunk/abcl/src/org/armedbear/lisp/CaseFrobStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/CaseFrobStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/CaseFrobStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -209,7 +209,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return unreadableString("CASE-FROB-STREAM");
     }

Modified: trunk/abcl/src/org/armedbear/lisp/CellError.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/CellError.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/CellError.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -102,9 +102,9 @@
     {
         if (Symbol.PRINT_ESCAPE.symbolValue() == NIL)
             return super.getMessage();
-        StringBuffer sb = new StringBuffer(typeOf().writeToString());
+        StringBuffer sb = new StringBuffer(typeOf().princToString());
         sb.append(' ');
-        sb.append(getCellName().writeToString());
+        sb.append(getCellName().princToString());
         return unreadableString(sb.toString());
     }
 }

Modified: trunk/abcl/src/org/armedbear/lisp/Closure.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Closure.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Closure.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -131,7 +131,7 @@
     final LispObject lambdaList = lambdaExpression.cadr();
     setLambdaList(lambdaList);
     if (!(lambdaList == NIL || lambdaList instanceof Cons))
-      error(new ProgramError("The lambda list " + lambdaList.writeToString() +
+      error(new ProgramError("The lambda list " + lambdaList.princToString() +
                            " is invalid."));
     boolean _andKey = false;
     boolean _allowOtherKeys = false;
@@ -387,7 +387,7 @@
   private static final void invalidParameter(LispObject obj)
 
   {
-    error(new ProgramError(obj.writeToString() +
+    error(new ProgramError(obj.princToString() +
                          " may not be used as a variable in a lambda list."));
   }
 
@@ -860,7 +860,7 @@
                             if (!allowOtherKeys &&
                                 (allowOtherKeysValue == null || allowOtherKeysValue == NIL))
                               error(new ProgramError("Unrecognized keyword argument " +
-                                                      unrecognizedKeyword.writeToString()));
+                                                      unrecognizedKeyword.printObject()));
                           }
                       }
                   }

Modified: trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -236,10 +236,10 @@
 	      return loadClassBytes((byte[]) arg.javaInstance(byte[].class));
 	  } catch(Throwable t) {
 	      Debug.trace(t);
-	      return error(new LispError("Unable to load " + arg.writeToString()));
+	      return error(new LispError("Unable to load " + arg.princToString()));
 	  }
       }
-      return error(new LispError("Unable to load " + arg.writeToString()));
+      return error(new LispError("Unable to load " + arg.princToString()));
     }
   };
 

Modified: trunk/abcl/src/org/armedbear/lisp/Complex.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Complex.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Complex.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -343,12 +343,12 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     StringBuilder sb = new StringBuilder("#C(");
-    sb.append(realpart.writeToString());
+    sb.append(realpart.printObject());
     sb.append(' ');
-    sb.append(imagpart.writeToString());
+    sb.append(imagpart.printObject());
     sb.append(')');
     return sb.toString();
   }

Modified: trunk/abcl/src/org/armedbear/lisp/ComplexArray.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ComplexArray.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/ComplexArray.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -233,7 +233,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return writeToString(dimv);
     }

Modified: trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte32.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte32.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte32.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -229,7 +229,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return writeToString(dimv);
     }

Modified: trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte8.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte8.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/ComplexArray_UnsignedByte8.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -226,7 +226,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (Symbol.PRINT_READABLY.symbolValue() != NIL) {
             error(new PrintNotReadable(list(Keyword.OBJECT, this)));

Modified: trunk/abcl/src/org/armedbear/lisp/Condition.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Condition.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Condition.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -178,11 +178,11 @@
       {
         return format(formatControl, getFormatArguments());
       }
-    return unreadableString(typeOf().writeToString());
+    return unreadableString(typeOf().princToString());
   }
 
   @Override
-  public final String writeToString()
+  public final String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     if (Symbol.PRINT_ESCAPE.symbolValue(thread) == NIL)
@@ -216,6 +216,6 @@
     int currentLevel = ((Fixnum)currentPrintLevel).value;
     if (currentLevel >= maxLevel)
       return "#";
-    return unreadableString(typeOf().writeToString());
+    return unreadableString(typeOf().princToString());
   }
 }

Modified: trunk/abcl/src/org/armedbear/lisp/Cons.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Cons.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Cons.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -498,7 +498,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     final LispObject printLength = Symbol.PRINT_LENGTH.symbolValue(thread);
@@ -522,7 +522,7 @@
             if (cdr.cdr() == NIL)
               {
                 sb.append('\'');
-                sb.append(cdr.car().writeToString());
+                sb.append(cdr.car().printObject());
                 return sb.toString();
               }
           }
@@ -535,7 +535,7 @@
             if (cdr.cdr() == NIL)
               {
                 sb.append("#'");
-                sb.append(cdr.car().writeToString());
+                sb.append(cdr.car().printObject());
                 return sb.toString();
               }
           }
@@ -555,14 +555,14 @@
             if (count < maxLength)
               {
                 LispObject p = this;
-                sb.append(p.car().writeToString());
+                sb.append(p.car().printObject());
                 ++count;
                 while ((p = p.cdr()) instanceof Cons)
                   {
                     sb.append(' ');
                     if (count < maxLength)
                       {
-                        sb.append(p.car().writeToString());
+                        sb.append(p.car().printObject());
                         ++count;
                       }
                     else
@@ -574,7 +574,7 @@
                 if (!truncated && p != NIL)
                   {
                     sb.append(" . ");
-                    sb.append(p.writeToString());
+                    sb.append(p.printObject());
                   }
               }
             else

Modified: trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -529,26 +529,26 @@
             else
                 m = (bits & 0xfffffffffffffL) | 0x10000000000000L;
             LispObject significand = number(m);
-//             Debug.trace("significand = " + significand.writeToString());
+//             Debug.trace("significand = " + significand.printObject());
             Fixnum exponent = Fixnum.getInstance(e - 1075);
-//             Debug.trace("exponent = " + exponent.writeToString());
+//             Debug.trace("exponent = " + exponent.printObject());
             Fixnum sign = Fixnum.getInstance(s);
-//             Debug.trace("sign = " + sign.writeToString());
+//             Debug.trace("sign = " + sign.printObject());
             LispObject result = significand;
-//             Debug.trace("result = " + result.writeToString());
+//             Debug.trace("result = " + result.printObject());
             result =
                 result.multiplyBy(MathFunctions.EXPT.execute(Fixnum.TWO, exponent));
-//             Debug.trace("result = " + result.writeToString());
+//             Debug.trace("result = " + result.printObject());
 
 
             result = result.truncate(Fixnum.ONE);
             LispObject remainder = coerceToFloat(thread._values[1]);
 
             result = result.multiplyBy(sign);
-//             Debug.trace("result = " + result.writeToString());
+//             Debug.trace("result = " + result.printObject());
 //             // Calculate remainder.
 //             LispObject product = result.multiplyBy(obj);
-//             Debug.trace("product = " + product.writeToString());
+//             Debug.trace("product = " + product.printObject());
 //             LispObject remainder = subtract(product);
             return thread.setValues(result, remainder);
         }
@@ -572,16 +572,16 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (value == Double.POSITIVE_INFINITY) {
             StringBuilder sb = new StringBuilder("#.");
-            sb.append(Symbol.DOUBLE_FLOAT_POSITIVE_INFINITY.writeToString());
+            sb.append(Symbol.DOUBLE_FLOAT_POSITIVE_INFINITY.printObject());
             return sb.toString();
         }
         if (value == Double.NEGATIVE_INFINITY) {
             StringBuilder sb = new StringBuilder("#.");
-            sb.append(Symbol.DOUBLE_FLOAT_NEGATIVE_INFINITY.writeToString());
+            sb.append(Symbol.DOUBLE_FLOAT_NEGATIVE_INFINITY.printObject());
             return sb.toString();
         }
 
@@ -646,7 +646,7 @@
             return new DoubleFloat(((SingleFloat)obj).value);
         if (obj instanceof Ratio)
             return new DoubleFloat(((Ratio)obj).doubleValue());
-        error(new TypeError("The value " + obj.writeToString() +
+        error(new TypeError("The value " + obj.princToString() +
                              " cannot be converted to type DOUBLE-FLOAT."));
         // Not reached.
         return null;

Modified: trunk/abcl/src/org/armedbear/lisp/Environment.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Environment.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Environment.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -245,7 +245,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     return unreadableString(Symbol.ENVIRONMENT);
   }

Modified: trunk/abcl/src/org/armedbear/lisp/FileStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/FileStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/FileStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -183,7 +183,7 @@
             String namestring = pathname.getNamestring();
             if (namestring == null)
                 return error(new SimpleError("Pathname has no namestring: " +
-                                              pathname.writeToString()));
+                                              pathname.princToString()));
             File file = new File(namestring);
             length = file.length(); // in 8-bit bytes
         }
@@ -263,7 +263,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return unreadableString(Symbol.FILE_STREAM);
     }

Modified: trunk/abcl/src/org/armedbear/lisp/Fixnum.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Fixnum.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Fixnum.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -939,7 +939,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));

Modified: trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -63,13 +63,13 @@
                             trap_underflow = true;
                         else
                             error(new LispError("Unsupported floating point trap: " +
-                                                 car.writeToString()));
+                                                 car.princToString()));
                         value = value.cdr();
                     }
                     TRAP_OVERFLOW  = trap_overflow;
                     TRAP_UNDERFLOW = trap_underflow;
                 } else
-                    error(new LispError("Unrecognized keyword: " + key.writeToString()));
+                    error(new LispError("Unrecognized keyword: " + key.princToString()));
             }
             return LispThread.currentThread().nothing();
         }

Modified: trunk/abcl/src/org/armedbear/lisp/ForwardReferencedClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ForwardReferencedClass.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/ForwardReferencedClass.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -65,13 +65,13 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb =
-            new StringBuffer(Symbol.FORWARD_REFERENCED_CLASS.writeToString());
+            new StringBuffer(Symbol.FORWARD_REFERENCED_CLASS.printObject());
         if (getName() != null) {
             sb.append(' ');
-            sb.append(getName().writeToString());
+            sb.append(getName().printObject());
         }
         return unreadableString(sb.toString());
     }
@@ -90,7 +90,7 @@
                 LispClass.addClass(name, c);
                 return c;
             }
-                return error(new TypeError(arg.writeToString() +
+                return error(new TypeError(arg.princToString() +
                                             " is not a valid class name."));
         }
     };

Modified: trunk/abcl/src/org/armedbear/lisp/Function.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Function.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Function.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -313,12 +313,12 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         LispObject name = getLambdaName();
         if (name != null && name != NIL) {
             StringBuffer sb = new StringBuffer("#<FUNCTION ");
-            sb.append(name.writeToString());
+            sb.append(name.printObject());
             sb.append(" {");
             sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
             sb.append("}>");
@@ -336,7 +336,7 @@
                 final SpecialBindingsMark mark = thread.markSpecialBindings();
                 thread.bindSpecial(Symbol.PRINT_LENGTH, Fixnum.THREE);
                 try {
-                    sb.append(lambdaList.writeToString());
+                    sb.append(lambdaList.printObject());
                 }
                 finally {
                     thread.resetSpecialBindings(mark);

Modified: trunk/abcl/src/org/armedbear/lisp/Go.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Go.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Go.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -58,7 +58,7 @@
     public LispObject getCondition()
     {
         StringBuffer sb = new StringBuffer("No tag named ");
-        sb.append(tag.writeToString());
+        sb.append(tag.princToString());
         sb.append(" is currently visible");
         return new ControlError(sb.toString());
     }

Modified: trunk/abcl/src/org/armedbear/lisp/HashTable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/HashTable.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/HashTable.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -225,14 +225,14 @@
     }
 
     @Override
-    public String writeToString() {
+    public String printObject() {
         if (Symbol.PRINT_READABLY.symbolValue(LispThread.currentThread()) != NIL) {
             error(new PrintNotReadable(list(Keyword.OBJECT, this)));
             return null; // Not reached.
         }
-        StringBuilder sb = new StringBuilder(getTest().writeToString());
+        StringBuilder sb = new StringBuilder(getTest().princToString());
         sb.append(' ');
-        sb.append(Symbol.HASH_TABLE.writeToString());
+        sb.append(Symbol.HASH_TABLE.princToString());
         sb.append(' ');
         sb.append(count);
         if (count == 1) {

Modified: trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -69,7 +69,7 @@
         if (test == FUNCTION_EQUALP)
           return HashTable.newEqualpHashTable(n, rehashSize, rehashThreshold);
         return error(new LispError("Unsupported test for MAKE-HASH-TABLE: " +
-                                    test.writeToString()));
+                                    test.princToString()));
       }
     };
 
@@ -102,7 +102,7 @@
           return WeakHashTable.newEqualpHashTable(n, rehashSize, 
 						  rehashThreshold, weakness);
         return error(new LispError("Unsupported test for MAKE-HASH-TABLE: " +
-                                    test.writeToString()));
+                                    test.princToString()));
       }
     };
 

Modified: trunk/abcl/src/org/armedbear/lisp/Interpreter.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Interpreter.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Interpreter.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -309,14 +309,14 @@
                             StringBuilder sb = new StringBuilder();
                             sb.append(separator);
                             sb.append("Caught ");
-                            sb.append(c.getCondition().typeOf().writeToString());
+                            sb.append(c.getCondition().typeOf().printObject());
                             sb.append(" while processing --eval option \"" +
                                       args[i + 1] + "\":");
                             sb.append(separator);
                             sb.append("  ");
                             final LispThread thread = LispThread.currentThread();
                             thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
-                            sb.append(c.getCondition().writeToString());
+                            sb.append(c.getCondition().princToString());
                             sb.append(separator);
                             System.err.print(sb.toString());
                             exit(2); // FIXME
@@ -408,10 +408,10 @@
                         slash = new Cons(values[i], slash);
                     Symbol.SLASH.setSymbolValue(slash);
                     for (int i = 0; i < values.length; i++)
-                        out._writeLine(values[i].writeToString());
+                        out._writeLine(values[i].printObject());
                 } else {
                     Symbol.SLASH.setSymbolValue(new Cons(result));
-                    out._writeLine(result.writeToString());
+                    out._writeLine(result.printObject());
                 }
                 out._finishOutput();
             }
@@ -445,7 +445,7 @@
         out.freshLine();
         Condition condition = (Condition) c.getCondition();
         out._writeLine("Error: unhandled condition: " +
-                       condition.writeToString());
+                       condition.princToString());
         if (thread != null)
             thread.printBacktrace();
     }
@@ -457,7 +457,7 @@
         out.freshLine();
         Condition condition = (Condition) c.getCondition();
         out._writeLine("Error: unhandled condition: " +
-                       condition.writeToString());
+                       condition.princToString());
         if (thread != null)
             thread.printBacktrace();
     }
@@ -516,7 +516,7 @@
             SpecialBindingsMark mark = thread.markSpecialBindings();
             thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
             try {
-                conditionText = getCondition().writeToString();
+                conditionText = getCondition().princToString();
             } catch (Throwable t) {
                 conditionText = "<error printing Lisp condition>";
             } finally {
@@ -552,14 +552,14 @@
                             final int offset =
                                 ((Stream)stream).getOffset();
                             Debug.trace("Error loading " +
-                                        truename.writeToString() +
+                                        truename.princToString() +
                                         " at line " + lineNumber +
                                         " (offset " + offset + ")");
                         }
                     }
                     Debug.trace("Encountered unhandled condition of type " +
-                                condition.typeOf().writeToString() + ':');
-                    Debug.trace("  " + condition.writeToString());
+                                condition.typeOf().princToString() + ':');
+                    Debug.trace("  " + condition.princToString());
                 }
                 catch (Throwable t) {} // catch any exception to throw below
                 finally {

Modified: trunk/abcl/src/org/armedbear/lisp/JarStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JarStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/JarStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -136,10 +136,10 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer();
-        sb.append(Symbol.JAR_STREAM.writeToString());
+        sb.append(Symbol.JAR_STREAM.princToString());
         String namestring = pathname.getNamestring();
         if (namestring != null) {
             sb.append(" ");

Modified: trunk/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Java.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Java.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -413,7 +413,7 @@
                 sb.append(methodName);
                 sb.append('(');
                 for (int i = 2; i < args.length; i++) {
-                    sb.append(args[i].writeToString());
+                    sb.append(args[i].princToString());
                     if (i < args.length - 1)
                         sb.append(',');
                 }
@@ -558,7 +558,7 @@
 		    } else if(object instanceof Class<?>) {
 			constructor = findConstructor((Class<?>) object, args);
 		    } else {
-			return error(new LispError(classRef.writeToString() + " is neither a Constructor nor a Class"));
+			return error(new LispError(classRef.princToString() + " is neither a Constructor nor a Class"));
 		    }
 		}
                 Class[] argTypes = constructor.getParameterTypes();
@@ -1393,7 +1393,7 @@
         if (javaObjectgetObject instanceof Class) {
             return (Class) javaObjectgetObject;
         }
-            error(new LispError(obj.writeToString() + " does not designate a Java class."));
+            error(new LispError(obj.princToString() + " does not designate a Java class."));
             return null;
     }
 

Modified: trunk/abcl/src/org/armedbear/lisp/JavaObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaObject.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/JavaObject.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -354,7 +354,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (obj instanceof ControlTransfer)
             return obj.toString();
@@ -540,9 +540,9 @@
         {
         final Object obj = javaObject.getObject();
         final StringBuilder sb =
-            new StringBuilder(javaObject.writeToString());
+            new StringBuilder(javaObject.princToString());
         sb.append(" is an object of type ");
-        sb.append(Symbol.JAVA_OBJECT.writeToString());
+        sb.append(Symbol.JAVA_OBJECT.princToString());
         sb.append(".");
         sb.append(System.getProperty("line.separator"));
         sb.append("The wrapped Java object is ");

Modified: trunk/abcl/src/org/armedbear/lisp/JavaStackFrame.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaStackFrame.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/JavaStackFrame.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -54,7 +54,7 @@
   public LispObject classOf()   { return BuiltInClass.JAVA_STACK_FRAME; }
 
   @Override
-  public String writeToString() { 
+  public String printObject() { 
     final String JAVA_STACK_FRAME = "JAVA-STACK-FRAME";
     return unreadableString(JAVA_STACK_FRAME + " "
 				+ toLispString().toString());

Modified: trunk/abcl/src/org/armedbear/lisp/Layout.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Layout.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Layout.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -135,7 +135,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     return unreadableString(Symbol.LAYOUT);
   }

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -514,7 +514,7 @@
               }
             else
               return error(new ProgramError("Illegal function object: " +
-                                             first.writeToString()));
+                                             first.princToString()));
           }
       }
     else
@@ -707,7 +707,7 @@
   {
     if (tagbody == null)
       return error(new ControlError("Unmatched tag "
-                                    + tag.writeToString() +
+                                    + tag.princToString() +
                                     " for GO outside lexical extent."));
 
     throw new Go(tagbody, tag);
@@ -724,7 +724,7 @@
   {
     if (binding.env.inactive)
       return error(new ControlError("Unmatched tag "
-                                    + binding.symbol.writeToString() +
+                                    + binding.symbol.princToString() +
                                     " for GO outside of lexical extent."));
 
     throw new Go(binding.env, binding.symbol);
@@ -743,7 +743,7 @@
   {
     if (blockId == null)
       return error(new ControlError("Unmatched block "
-                                    + blockName.writeToString() + " for " +
+                                    + blockName.princToString() + " for " +
                                     "RETURN-FROM outside lexical extent."));
 
     throw new Return(blockId, result);
@@ -767,7 +767,7 @@
 
     if (binding.env.inactive)
       return error(new ControlError("Unmatched block "
-                                    + binding.symbol.writeToString() +
+                                    + binding.symbol.princToString() +
                                     " for RETURN-FROM outside of" +
                                     " lexical extent."));
 
@@ -796,7 +796,7 @@
                   Binding binding = env.getTagBinding(tag);
                   if (binding == null)
                     return error(new ControlError("No tag named " +
-                                                  tag.writeToString() +
+                                                  tag.princToString() +
                                                   " is currently visible."));
                   else if (memql(tag, localTags))
                     {
@@ -1118,7 +1118,7 @@
         else {
            Symbol.GENSYM_COUNTER.setSymbolValue(Fixnum.ZERO);
            error(new TypeError("The value of *GENSYM-COUNTER* was not a nonnegative integer. Old value: " +
-                                oldValue.writeToString() + " New value: 0"));
+                                oldValue.princToString() + " New value: 0"));
         }
     } else {
         // we're manipulating a global resource
@@ -1131,7 +1131,7 @@
             else {
                Symbol.GENSYM_COUNTER.setSymbolValue(Fixnum.ZERO);
                error(new TypeError("The value of *GENSYM-COUNTER* was not a nonnegative integer. Old value: " +
-                                    oldValue.writeToString() + " New value: 0"));
+                                    oldValue.princToString() + " New value: 0"));
             }
         }
     }
@@ -1421,7 +1421,7 @@
   public static final String safeWriteToString(LispObject obj)
   {
     try {
-        return obj.writeToString();
+        return obj.printObject();
       }
     catch (NullPointerException e)
       {
@@ -1635,7 +1635,7 @@
           if (stream.isCharacterInputStream())      
                   return stream;                        
           return (Stream) // Not reached.                      
-          error(new TypeError("The value " + obj.writeToString() +
+          error(new TypeError("The value " + obj.princToString() +
                         " is not a character input stream."));
   }
 
@@ -1646,7 +1646,7 @@
           if (stream.isCharacterOutputStream())      
                   return stream;                        
         return (Stream) // Not reached.
-        error(new TypeError("The value " + obj.writeToString() +
+        error(new TypeError("The value " + obj.princToString() +
                             " is not a character output stream."));
   }
 
@@ -1657,7 +1657,7 @@
           if (stream.isBinaryInputStream())      
                   return stream;                        
         return (Stream) // Not reached.
-        error(new TypeError("The value " + obj.writeToString() +
+        error(new TypeError("The value " + obj.princToString() +
                              " is not a binary input stream."));
   }
   
@@ -1786,7 +1786,7 @@
     Package pkg = Packages.findPackage(javaString(obj));
     if (pkg != null)
       return pkg;
-    error(new PackageError(obj.writeToString() + " is not the name of a package."));
+    error(new PackageError(obj.princToString() + " is not the name of a package."));
     // Not reached.
     return null;
   }
@@ -1873,7 +1873,7 @@
           list = list.cddr();
         else
           return error(new TypeError("Malformed property list: " +
-                                      plist.writeToString()));
+                                      plist.princToString()));
       }
     return defaultValue;
   }
@@ -1956,7 +1956,7 @@
     while (list != NIL)
       {
         if (!(list.cdr() instanceof Cons))
-          error(new ProgramError("The symbol " + symbol.writeToString() +
+          error(new ProgramError("The symbol " + symbol.princToString() +
                                   " has an odd number of items in its property list."));
         if (list.car() == indicator)
           {
@@ -2010,7 +2010,7 @@
                         thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
                         thread.bindSpecial(Symbol.PRINT_READABLY, NIL);
                         try {
-                            sb.append(obj.writeToString());
+                            sb.append(obj.printObject());
                         }
                         finally {
                             thread.resetSpecialBindings(mark);
@@ -2025,7 +2025,7 @@
                         final SpecialBindingsMark mark = thread.markSpecialBindings();
                         thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
                         try {
-                            sb.append(obj.writeToString());
+                            sb.append(obj.printObject());
                         }
                         finally {
                             thread.resetSpecialBindings(mark);
@@ -2042,7 +2042,7 @@
                         thread.bindSpecial(Symbol.PRINT_RADIX, NIL);
                         thread.bindSpecial(Symbol.PRINT_BASE, Fixnum.constants[10]);
                         try {
-                            sb.append(obj.writeToString());
+                            sb.append(obj.printObject());
                         }
                         finally {
                             thread.resetSpecialBindings(mark);
@@ -2059,7 +2059,7 @@
                         thread.bindSpecial(Symbol.PRINT_RADIX, NIL);
                         thread.bindSpecial(Symbol.PRINT_BASE, Fixnum.constants[16]);
                         try {
-                            sb.append(obj.writeToString());
+                            sb.append(obj.printObject());
                         }
                         finally {
                             thread.resetSpecialBindings(mark);
@@ -2703,7 +2703,7 @@
   static class unboundValue extends LispObject
   {
     @Override
-    public String writeToString()
+    public String printObject()
     {
       return "#<UNBOUND>";
     }
@@ -2713,7 +2713,7 @@
   static class nullValue extends LispObject
   {
     @Override
-    public String writeToString()
+    public String printObject()
     {
       return "null";
     }

Modified: trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispCharacter.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/LispCharacter.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -223,7 +223,7 @@
   }
 
   @Override
-  public final String writeToString()
+  public final String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     boolean printReadably = (Symbol.PRINT_READABLY.symbolValue(thread) != NIL);

Modified: trunk/abcl/src/org/armedbear/lisp/LispClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispClass.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/LispClass.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -75,7 +75,7 @@
       {
         StringBuilder sb =
           new StringBuilder("There is no class named ");
-        sb.append(name.writeToString());
+        sb.append(name.princToString());
         sb.append('.');
         return error(new LispError(sb.toString()));
       }

Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -65,7 +65,7 @@
   public LispObject getDescription()
   {
     StringBuilder sb = new StringBuilder("An object of type ");
-    sb.append(typeOf().writeToString());
+    sb.append(typeOf().princToString());
     sb.append(" at #x");
     sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
     return new SimpleString(sb);
@@ -130,7 +130,7 @@
   {
       if (c.isAssignableFrom(getClass()))
 	  return this;
-      return error(new LispError("The value " + writeToString() +
+      return error(new LispError("The value " + princToString() +
 				 " is not of class " + c.getName()));
   }
 
@@ -731,7 +731,25 @@
     return type_error(this, Symbol.SYMBOL);
   }
 
-  public String writeToString()
+  /** PRINC-TO-STRING function to be used with Java objects
+   * 
+   * @return A string in human-readable format, as per PRINC definition
+   */
+  public String princToString()
+  {
+      LispThread thread = LispThread.currentThread();
+      SpecialBindingsMark mark = thread.markSpecialBindings();
+      try {
+          thread.bindSpecial(Symbol.PRINT_READABLY, NIL);
+          thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
+          return printObject();
+      }
+      finally {
+          thread.resetSpecialBindings(mark);
+      }
+  }
+  
+  public String printObject()
   {
     return toString();
   }
@@ -759,7 +777,7 @@
   public final String unreadableString(Symbol symbol, boolean identity) 
 
   {
-    return unreadableString(symbol.writeToString(), identity);
+    return unreadableString(symbol.printObject(), identity);
   }
 
   // Special operator
@@ -1149,7 +1167,7 @@
 
   public LispObject STRING()
   {
-    return error(new TypeError(writeToString() + " cannot be coerced to a string."));
+    return error(new TypeError(princToString() + " cannot be coerced to a string."));
   }
 
   public char[] chars()

Modified: trunk/abcl/src/org/armedbear/lisp/LispStackFrame.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispStackFrame.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/LispStackFrame.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -48,7 +48,7 @@
   {
     public UnavailableArgument () { }
     @Override
-    public String writeToString() { 
+    public String printObject() { 
       return unreadableString("unavailable arg", false); 
     }
   }
@@ -114,12 +114,12 @@
    }
 
    @Override
-   public String writeToString() 
+   public String printObject() 
    { 
      String result = "";
      final String LISP_STACK_FRAME = "LISP-STACK-FRAME";
      try {
-	 result = Symbol.PRIN1_TO_STRING.execute(this.toLispList()).writeToString();
+	 result = Symbol.PRIN1_TO_STRING.execute(this.toLispList()).printObject();
      } catch (Throwable t) { // error while printing stack
        Debug.trace("Serious printing error: ");
        Debug.trace(t);
@@ -190,7 +190,7 @@
   {
     String result;
     try {
-      result = this.toLispList().writeToString();
+      result = this.toLispList().printObject();
     } catch (Throwable t) { // error while printing stack
       Debug.trace("Serious printing error: ");
       Debug.trace(t);

Modified: trunk/abcl/src/org/armedbear/lisp/LispThread.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispThread.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/LispThread.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -586,7 +586,7 @@
             rest = rest.cdr();
         }
         error(new ControlError("Attempt to throw to the nonexistent tag " +
-                                tag.writeToString() + "."));
+                                tag.princToString() + "."));
     }
 
 
@@ -871,7 +871,7 @@
                 sb.append(' ');
             stream._writeString(sb.toString());
         }
-        String raw = obj.writeToString();
+        String raw = obj.printObject();
         if (stream.getCharPos() + raw.length() < 80) {
             // It fits.
             stream._writeString(raw);
@@ -917,7 +917,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer("THREAD");
         if (name != NIL) {
@@ -948,7 +948,7 @@
                     name = args[2].STRING();
                 else
                     error(new ProgramError("Unrecognized keyword argument " +
-                                            args[1].writeToString() + "."));
+                                            args[1].princToString() + "."));
             }
             return new LispThread(checkFunction(args[0]), name);
         }

Modified: trunk/abcl/src/org/armedbear/lisp/Load.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Load.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Load.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -288,7 +288,7 @@
 
         // Look for a init FASL inside a packed FASL
         if (truename != null
-            && truename.type.writeToString().equals(COMPILE_FILE_TYPE) && Utilities.checkZipFile(truename))  {
+            && truename.type.princToString().equals(COMPILE_FILE_TYPE) && Utilities.checkZipFile(truename))  {
             Pathname init = new Pathname(truename.getNamestring());
             init.type = COMPILE_FILE_INIT_FASL_TYPE;
             LispObject t = Pathname.truename(init);
@@ -416,10 +416,10 @@
             }
             return
                 error(new SimpleError("FASL version mismatch; found '"
-                        + second.writeToString() + "' but expected '"
-                        + _FASL_VERSION_.getSymbolValue().writeToString()
+                        + second.princToString() + "' but expected '"
+                        + _FASL_VERSION_.getSymbolValue().princToString()
                         + "' in "
-                        + Symbol.LOAD_PATHNAME.symbolValue(thread).writeToString()));
+                        + Symbol.LOAD_PATHNAME.symbolValue(thread).princToString()));
         }
     }
 
@@ -525,7 +525,7 @@
                 out.freshLine();
                 out._writeString(prefix);
                 out._writeString(auto ? " Autoloading " : " Loading ");
-                out._writeString(!truename.equals(NIL) ? truePathname.writeToString() : "stream");
+                out._writeString(!truename.equals(NIL) ? truePathname.princToString() : "stream");
                 out._writeLine(" ...");
                 out._finishOutput();
                 LispObject result = loadStream(in, print, thread, returnLastResult);
@@ -533,7 +533,7 @@
                 out.freshLine();
                 out._writeString(prefix);
                 out._writeString(auto ? " Autoloaded " : " Loaded ");
-                out._writeString(!truename.equals(NIL) ? truePathname.writeToString() : "stream");
+                out._writeString(!truename.equals(NIL) ? truePathname.princToString() : "stream");
                 out._writeString(" (");
                 out._writeString(String.valueOf(((float)elapsed)/1000));
                 out._writeLine(" seconds)");
@@ -576,7 +576,7 @@
                 if (print) {
                     Stream out =
                         checkCharacterOutputStream(Symbol.STANDARD_OUTPUT.symbolValue(thread));
-                    out._writeLine(result.writeToString());
+                    out._writeLine(result.printObject());
                     out._finishOutput();
                 }
             }

Modified: trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -215,7 +215,7 @@
             } else if (part == Keyword.RELATIVE)
                 sb.append(';');
             else
-                error(new FileError("Unsupported directory component " + part.writeToString() + ".",
+                error(new FileError("Unsupported directory component " + part.princToString() + ".",
                                      this));
             temp = temp.cdr();
             while (temp != NIL) {
@@ -229,7 +229,7 @@
                 else if (part == Keyword.UP)
                     sb.append("..");
                 else
-                    error(new FileError("Unsupported directory component " + part.writeToString() + ".",
+                    error(new FileError("Unsupported directory component " + part.princToString() + ".",
                                          this));
                 sb.append(';');
                 temp = temp.cdr();
@@ -239,7 +239,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         final LispThread thread = LispThread.currentThread();
         boolean printReadably = (Symbol.PRINT_READABLY.symbolValue(thread) != NIL);

Modified: trunk/abcl/src/org/armedbear/lisp/MacroObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/MacroObject.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/MacroObject.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -129,7 +129,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     return unreadableString("MACRO-OBJECT");
   }

Modified: trunk/abcl/src/org/armedbear/lisp/MathFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/MathFunctions.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/MathFunctions.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -667,7 +667,7 @@
                 x = ((DoubleFloat)base).value;
             else
                 return error(new LispError("EXPT: unsupported case: base is of type " +
-                                            base.typeOf().writeToString()));
+                                            base.typeOf().princToString()));
 
             if (power instanceof Fixnum)
                 y = ((Fixnum)power).value;
@@ -681,7 +681,7 @@
                 y = ((DoubleFloat)power).value;
             else
                 return error(new LispError("EXPT: unsupported case: power is of type " +
-                                            power.typeOf().writeToString()));
+                                            power.typeOf().princToString()));
             double r = Math.pow(x, y);
             if (Double.isNaN(r)) {
                 if (x < 0) {

Modified: trunk/abcl/src/org/armedbear/lisp/Package.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Package.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Package.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -846,7 +846,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (_PRINT_FASL_.symbolValue() != NIL && name != null) {
             StringBuilder sb = new StringBuilder("#.(FIND-PACKAGE \"");

Modified: trunk/abcl/src/org/armedbear/lisp/PackageFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/PackageFunctions.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/PackageFunctions.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -342,7 +342,7 @@
                     LispObject string = obj.STRING();
                     Package p = Packages.findPackage(string.getStringValue());
                     if (p == null)
-                        return error(new LispError(obj.writeToString() +
+                        return error(new LispError(obj.princToString() +
                                                     " is not the name of a package."));
                     pkg.usePackage(p);
                 }

Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -773,7 +773,7 @@
                 // else: Nothing to do.
             } else {
                 error(new FileError("Unsupported directory component "
-                  + part.writeToString() + ".",
+                  + part.printObject() + ".",
                   this));
             }
             while (temp != NIL) {
@@ -787,7 +787,7 @@
                 } else if (part == Keyword.UP) {
                     sb.append("..");
                 } else {
-                    error(new FileError("Unsupported directory component " + part.writeToString() + ".",
+                    error(new FileError("Unsupported directory component " + part.princToString() + ".",
                       this));
                 }
                 sb.append(separatorChar);
@@ -886,7 +886,7 @@
     }
 
     @Override
-    public String writeToString() {
+    public String printObject() {
         final LispThread thread = LispThread.currentThread();
         final boolean printReadably = (Symbol.PRINT_READABLY.symbolValue(thread) != NIL);
         final boolean printEscape = (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL);
@@ -939,32 +939,32 @@
         sb.append("PATHNAME (with no namestring) ");
         if (host != NIL) {
             sb.append(":HOST ");
-            sb.append(host.writeToString());
+            sb.append(host.printObject());
             sb.append(" ");
         }
         if (device != NIL) {
             sb.append(":DEVICE ");
-            sb.append(device.writeToString());
+            sb.append(device.printObject());
             sb.append(" ");
         }
         if (directory != NIL) {
             sb.append(":DIRECTORY ");
-            sb.append(directory.writeToString());
+            sb.append(directory.printObject());
             sb.append(" ");
         }
         if (name != NIL) {
             sb.append(":NAME ");
-            sb.append(name.writeToString());
+            sb.append(name.printObject());
             sb.append(" ");
         }
         if (type != NIL) {
             sb.append(":TYPE ");
-            sb.append(type.writeToString());
+            sb.append(type.printObject());
             sb.append(" ");
         }
         if (version != NIL) {
             sb.append(":VERSION ");
-            sb.append(version.writeToString());
+            sb.append(version.printObject());
             sb.append(" ");
         }
         if (sb.charAt(sb.length() - 1) == ' ') { 
@@ -1067,7 +1067,7 @@
             // A defined logical pathname host.
             return new LogicalPathname(host.getStringValue(), s);
         }
-        error(new LispError(host.writeToString() + " is not defined as a logical pathname host."));
+        error(new LispError(host.princToString() + " is not defined as a logical pathname host."));
         // Not reached.
         return null;
     }
@@ -1184,7 +1184,7 @@
             String namestring = pathname.getNamestring();
             if (namestring == null) {
                 error(new SimpleError("Pathname has no namestring: "
-                                      + pathname.writeToString()));
+                                      + pathname.princToString()));
             }
             return new SimpleString(namestring);
         }
@@ -1374,7 +1374,7 @@
             }
             if (LOGICAL_PATHNAME_TRANSLATIONS.get(logicalHost) == null) {
                 // Not a defined logical pathname host -- A UNC path
-                //warning(new LispError(host.writeToString() + " is not defined as a logical pathname host."));
+                //warning(new LispError(host.printObject() + " is not defined as a logical pathname host."));
                 p = new Pathname();
                 logical = false;
                 p.host = host;
@@ -1415,7 +1415,7 @@
                 } else if (directory == Keyword.WILD || directory == Keyword.WILD_INFERIORS) {
                     p.directory = directory;
                 } else {
-                    error(new LispError("Invalid directory component for logical pathname: " + directory.writeToString()));
+                    error(new LispError("Invalid directory component for logical pathname: " + directory.princToString()));
                 }
             } else {
                 p.directory = directory;
@@ -1468,9 +1468,9 @@
                 if (second == Keyword.UP || second == Keyword.BACK) {
                     if (signalError) {
                         StringBuilder sb = new StringBuilder();
-                        sb.append(first.writeToString());
+                        sb.append(first.printObject());
                         sb.append(" may not be followed immediately by ");
-                        sb.append(second.writeToString());
+                        sb.append(second.printObject());
                         sb.append('.');
                         error(new FileError(sb.toString(), this));
                     }
@@ -1630,7 +1630,7 @@
                             result = new Cons(p, result);
                         }
                     } catch (IOException e) {
-                        return error(new FileError("Unable to list directory " + pathname.writeToString() + ".",
+                        return error(new FileError("Unable to list directory " + pathname.princToString() + ".",
                                                    pathname));
                     } catch (SecurityException e) {
                         Debug.trace(e);
@@ -1807,7 +1807,7 @@
             Cons d = (Cons) directory;
             while (true) {
                 if (d.car() instanceof AbstractString) {
-                    String s = d.car().writeToString();
+                    String s = d.car().printObject();
                     if (s.contains("*")) {
                         return true;
                     }
@@ -1822,7 +1822,7 @@
             return true;
         }
         if (name instanceof AbstractString) {
-            if (name.writeToString().contains("*")) {
+            if (name.printObject().contains("*")) {
                 return true;
             }
         }
@@ -1830,7 +1830,7 @@
             return true;
         }
         if (type instanceof AbstractString) {
-            if (type.writeToString().contains("*")) {
+            if (type.printObject().contains("*")) {
                 return true;
             }
         }
@@ -1882,7 +1882,7 @@
                 value = pathname.version;
             } else {
                 return error(new ProgramError("Unrecognized keyword "
-                                              + second.writeToString() + "."));
+                                              + second.princToString() + "."));
             }
             if (value == Keyword.WILD || value == Keyword.WILD_INFERIORS) {
                 return T;
@@ -2126,7 +2126,7 @@
             final String namestring = pathname.getNamestring();
             if (namestring == null) {
                 return error(new FileError("Pathname has no namestring: " 
-                                           + pathname.writeToString(),
+                                           + pathname.princToString(),
                                            pathname));
             }
             
@@ -2231,7 +2231,7 @@
         error:
         if (errorIfDoesNotExist) {
             StringBuilder sb = new StringBuilder("The file ");
-            sb.append(pathname.writeToString());
+            sb.append(pathname.princToString());
             sb.append(" does not exist.");
             return error(new FileError(sb.toString(), pathname));
         }
@@ -2461,8 +2461,8 @@
                 }
             }
             return error(new FileError("Unable to rename "
-                                       + original.writeToString()
-                                       + " to " + newName.writeToString()
+                                       + original.princToString()
+                                       + " to " + newName.princToString()
                                        + "."));
         }
     }

Modified: trunk/abcl/src/org/armedbear/lisp/Primitives.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Primitives.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Primitives.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -677,7 +677,7 @@
             final LispObject value;
             value = checkSymbol(arg).symbolValue();
             if (value instanceof SymbolMacro)
-                return error(new LispError(arg.writeToString() +
+                return error(new LispError(arg.princToString() +
                                            " has no dynamic value."));
             return value;
         }
@@ -884,7 +884,7 @@
         public LispObject execute(LispObject first, LispObject second)
 
         {
-            checkStream(second)._writeString(first.writeToString());
+            checkStream(second)._writeString(first.printObject());
             return first;
         }
     };
@@ -907,7 +907,7 @@
                 out = Symbol.STANDARD_OUTPUT.symbolValue();
             else
                 out = second;
-            String output = first.writeToString();
+            String output = first.printObject();
             if (Symbol.PRINT_READABLY.symbolValue(LispThread.currentThread()) != NIL
                 && output.contains("#<")) {
                 //### Ticket #160: the cause lies here.
@@ -934,7 +934,7 @@
 
         @Override
         public LispObject execute(LispObject arg) {
-            return new SimpleString(arg.writeToString());
+            return new SimpleString(arg.printObject());
         }
     };
 
@@ -1596,11 +1596,11 @@
             System.out.println("ERROR placeholder called with arguments:");
 
             if (args.length == 1 && args[0] instanceof Condition) {
-                System.out.println(args[0].writeToString());
+                System.out.println(args[0].princToString());
                 System.out.println(((Condition)args[0]).getConditionReport());
             } else
             for (LispObject a : args)
-                System.out.println(a.writeToString());
+                System.out.println(a.princToString());
 
             throw e;
         }
@@ -1733,7 +1733,7 @@
                     return NIL;
                 }
                 error(new TypeError("The value " +
-                                    destination.writeToString() +
+                                    destination.princToString() +
                                     " is not a character output stream."));
             }
             if (destination instanceof Stream) {
@@ -2423,7 +2423,7 @@
                 array = (ZeroRankArray) first;
             } else {
                 return error(new TypeError("The value " +
-                                           first.writeToString() +
+                                           first.princToString() +
                                            " is not an array of rank 0."));
             }
             array.aset(0, second);
@@ -3262,7 +3262,7 @@
                         String s = javaString(obj);
                         Package p = Packages.findPackage(s);
                         if (p == null) {
-                            error(new LispError(obj.writeToString() +
+                            error(new LispError(obj.princToString() +
                                                 " is not the name of a package."));
                             return NIL;
                         }
@@ -3287,7 +3287,7 @@
                     String s = javaString(obj);
                     Package p = Packages.findPackage(s);
                     if (p == null) {
-                        error(new LispError(obj.writeToString() +
+                        error(new LispError(obj.princToString() +
                                             " is not the name of a package."));
                         return NIL;
                     }
@@ -3713,7 +3713,7 @@
             Binding binding = env.getTagBinding(args.car());
             if (binding == null)
                 return error(new ControlError("No tag named " +
-                                              args.car().writeToString() +
+                                              args.car().princToString() +
                                               " is currently visible."));
 
             return nonLocalGo(binding, args.car());
@@ -4014,7 +4014,7 @@
             } else if (obj instanceof Function) {
                 function = obj;
             } else {
-                error(new LispError(obj.writeToString() +
+                error(new LispError(obj.princToString() +
                                     " is not a function name."));
                 return NIL;
             }

Modified: trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -85,16 +85,7 @@
         LispObject object = UNBOUND_VALUE;
         object = getInstanceSlotValue(Symbol.OBJECT);
         if (object != UNBOUND_VALUE) {
-            final LispThread thread = LispThread.currentThread();
-            final SpecialBindingsMark mark = thread.markSpecialBindings();
-            thread.bindSpecial(Symbol.PRINT_READABLY, NIL);
-            thread.bindSpecial(Symbol.PRINT_ARRAY, NIL);
-            try {
-                sb.append(object.writeToString());
-            }
-            finally {
-                thread.resetSpecialBindings(mark);
-            }
+            sb.append(object.princToString());
         } else
             sb.append("Object");
         sb.append(" cannot be printed readably.");

Modified: trunk/abcl/src/org/armedbear/lisp/RandomState.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/RandomState.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/RandomState.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -91,7 +91,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return unreadableString(Symbol.RANDOM_STATE);
     }

Modified: trunk/abcl/src/org/armedbear/lisp/Ratio.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Ratio.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Ratio.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -553,7 +553,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         final LispThread thread = LispThread.currentThread();
         int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));

Modified: trunk/abcl/src/org/armedbear/lisp/Readtable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Readtable.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Readtable.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -291,7 +291,7 @@
     if (dispatchTable == null)
       {
         LispCharacter c = LispCharacter.getInstance(dispChar);
-        return error(new LispError(c.writeToString() +
+        return error(new LispError(c.princToString() +
                                     " is not a dispatch character."));
       }
     LispObject function =
@@ -307,7 +307,7 @@
     if (dispatchTable == null)
       {
         LispCharacter c = LispCharacter.getInstance(dispChar);
-        error(new LispError(c.writeToString() +
+        error(new LispError(c.princToString() +
                              " is not a dispatch character."));
       }
     dispatchTable.functions.put(LispCharacter.toUpperCase(subChar), function);
@@ -426,7 +426,7 @@
         else if (second instanceof Symbol)
           designator = second;
         else
-          return error(new LispError(second.writeToString() +
+          return error(new LispError(second.princToString() +
                                       " does not designate a function."));
         byte syntaxType;
         if (third != NIL)

Modified: trunk/abcl/src/org/armedbear/lisp/Return.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Return.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Return.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -72,7 +72,7 @@
     public LispObject getCondition()
     {
         StringBuilder sb = new StringBuilder("No block named ");
-        sb.append(tag.writeToString());
+        sb.append(tag.princToString());
         sb.append(" is currently visible.");
         return new ControlError(sb.toString());
     }

Modified: trunk/abcl/src/org/armedbear/lisp/ShellCommand.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ShellCommand.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/ShellCommand.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -259,7 +259,7 @@
                     Pathname pathname = coerceToPathname(second);
                     namestring = pathname.getNamestring();
                     if (namestring == null) {
-                        return error(new FileError("Pathname has no namestring: " + pathname.writeToString(),
+                        return error(new FileError("Pathname has no namestring: " + pathname.princToString(),
                                                     pathname));
                     }
                 }

Modified: trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -319,7 +319,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     return writeToString(dimv);
   }

Modified: trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte16.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte16.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte16.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -291,7 +291,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (Symbol.PRINT_READABLY.symbolValue() != NIL) {
             error(new PrintNotReadable(list(Keyword.OBJECT, this)));

Modified: trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte32.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte32.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte32.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -281,7 +281,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (Symbol.PRINT_READABLY.symbolValue() != NIL) {
             error(new PrintNotReadable(list(Keyword.OBJECT, this)));

Modified: trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte8.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte8.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SimpleArray_UnsignedByte8.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -278,7 +278,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (Symbol.PRINT_READABLY.symbolValue() != NIL) {
             error(new PrintNotReadable(list(Keyword.OBJECT, this)));

Modified: trunk/abcl/src/org/armedbear/lisp/SingleFloat.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SingleFloat.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SingleFloat.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -561,16 +561,16 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         if (value == Float.POSITIVE_INFINITY) {
             StringBuffer sb = new StringBuffer("#.");
-            sb.append(Symbol.SINGLE_FLOAT_POSITIVE_INFINITY.writeToString());
+            sb.append(Symbol.SINGLE_FLOAT_POSITIVE_INFINITY.printObject());
             return sb.toString();
         }
         if (value == Float.NEGATIVE_INFINITY) {
             StringBuffer sb = new StringBuffer("#.");
-            sb.append(Symbol.SINGLE_FLOAT_NEGATIVE_INFINITY.writeToString());
+            sb.append(Symbol.SINGLE_FLOAT_NEGATIVE_INFINITY.printObject());
             return sb.toString();
         }
 
@@ -640,7 +640,7 @@
             return new SingleFloat(((Bignum)obj).floatValue());
         if (obj instanceof Ratio)
             return new SingleFloat(((Ratio)obj).floatValue());
-        error(new TypeError("The value " + obj.writeToString() +
+        error(new TypeError("The value " + obj.princToString() +
                              " cannot be converted to type SINGLE-FLOAT."));
         // Not reached.
         return null;

Modified: trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -116,15 +116,15 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     StringBuilder sb =
-      new StringBuilder(Symbol.SLOT_DEFINITION.writeToString());
+      new StringBuilder(Symbol.SLOT_DEFINITION.printObject());
     LispObject name = slots[SlotDefinitionClass.SLOT_INDEX_NAME];
     if (name != null && name != NIL)
       {
         sb.append(' ');
-        sb.append(name.writeToString());
+        sb.append(name.printObject());
       }
     return unreadableString(sb.toString());
   }

Modified: trunk/abcl/src/org/armedbear/lisp/SpecialOperator.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SpecialOperator.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SpecialOperator.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -146,10 +146,10 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer("#<SPECIAL-OPERATOR ");
-        sb.append(lambdaName.writeToString());
+        sb.append(lambdaName.princToString());
         sb.append(">");
         return sb.toString();
     }

Modified: trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -141,7 +141,7 @@
                     if (obj.length() > 2)
                         return error(new LispError("The " + (sequential ? "LET*" : "LET")
                                                    + " binding specification " +
-                                                   obj.writeToString() + " is invalid."));
+                                                   obj.princToString() + " is invalid."));
                     symbol = checkSymbol(((Cons)obj).car);
                     value = eval(obj.cadr(), sequential ? ext : env, thread);
                 } else {
@@ -201,14 +201,14 @@
                                 || ext.isDeclaredSpecial(symbol)) {
                             return error(new ProgramError(
                                              "Attempt to bind the special variable " +
-                                             symbol.writeToString() +
+                                             symbol.princToString() +
                                              " with SYMBOL-MACROLET."));
                         }
                         bindArg(null, symbol, new SymbolMacro(obj.cadr()), ext, thread);
                     } else {
                         return error(new ProgramError(
                                          "Malformed symbol-expansion pair in SYMBOL-MACROLET: " +
-                                         obj.writeToString()));
+                                         obj.princToString()));
                     }
                 }
                 return progn(body, ext, thread);
@@ -519,7 +519,7 @@
             while (args != NIL) {
                 Symbol symbol = checkSymbol(args.car());
                 if (symbol.isConstant()) {
-                    return error(new ProgramError(symbol.writeToString() +
+                    return error(new ProgramError(symbol.princToString() +
                                                   " is a constant and thus cannot be set."));
                 }
                 args = args.cdr();

Modified: trunk/abcl/src/org/armedbear/lisp/StandardClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardClass.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StandardClass.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -139,9 +139,9 @@
         (new Error()).printStackTrace();
         LispThread.currentThread().printBacktrace();
         return (Layout)Lisp.error(Symbol.TYPE_ERROR,
-                new SimpleString("The value " + layout.writeToString()
-                    + " is not of expected type " + Symbol.LAYOUT.writeToString()
-                    + " in class " + this.writeToString() + "."));
+                new SimpleString("The value " + layout.princToString()
+                    + " is not of expected type " + Symbol.LAYOUT.princToString()
+                    + " in class " + this.princToString() + "."));
       }
     
     return (layout == UNBOUND_VALUE) ? null : (Layout)layout;
@@ -320,14 +320,14 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     StringBuilder sb =
-      new StringBuilder(Symbol.STANDARD_CLASS.writeToString());
+      new StringBuilder(Symbol.STANDARD_CLASS.printObject());
     if (getName() != null)
       {
         sb.append(' ');
-        sb.append(getName().writeToString());
+        sb.append(getName().printObject());
       }
     return unreadableString(sb.toString());
   }

Modified: trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -203,7 +203,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     LispObject name = getGenericFunctionName();
     if (name != null)
@@ -216,12 +216,12 @@
         else
           className = Symbol.CLASS_NAME.execute(lispClass);
 
-        sb.append(className.writeToString());
+        sb.append(className.princToString());
         sb.append(' ');
-        sb.append(name.writeToString());
+        sb.append(name.princToString());
         return unreadableString(sb.toString());
       }
-    return super.writeToString();
+    return super.printObject();
   }
 
   // Profiling.

Modified: trunk/abcl/src/org/armedbear/lisp/StandardMethod.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardMethod.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StandardMethod.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -145,7 +145,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     LispObject genericFunction =
       slots[StandardMethodClass.SLOT_INDEX_GENERIC_FUNCTION];
@@ -163,9 +163,9 @@
             else
               className = Symbol.CLASS_NAME.execute(lispClass);
 
-            sb.append(className.writeToString());
+            sb.append(className.printObject());
             sb.append(' ');
-            sb.append(name.writeToString());
+            sb.append(name.printObject());
             LispObject specializers =
               slots[StandardMethodClass.SLOT_INDEX_SPECIALIZERS];
             if (specializers != null)
@@ -182,12 +182,12 @@
                     specs = specs.cdr();
                   }
                 sb.append(' ');
-                sb.append(names.nreverse().writeToString());
+                sb.append(names.nreverse().printObject());
               }
             return unreadableString(sb.toString());
           }
       }
-    return super.writeToString();
+    return super.printObject();
   }
 
   // ### %method-generic-function

Modified: trunk/abcl/src/org/armedbear/lisp/StandardObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardObject.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StandardObject.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -196,7 +196,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     final LispThread thread = LispThread.currentThread();
     int maxLevel = Integer.MAX_VALUE;
@@ -208,7 +208,7 @@
     int currentLevel = Fixnum.getValue(currentPrintLevel);
     if (currentLevel >= maxLevel)
       return "#";
-    return unreadableString(typeOf().writeToString());
+    return unreadableString(typeOf().printObject());
   }
 
   Layout updateLayout()
@@ -304,7 +304,7 @@
     int index = layout.getSlotIndex(slotName);
     //### FIXME: should call SLOT-MISSING (clhs)
     if (index < 0)
-      return error(new LispError("Missing slot " + slotName.writeToString()));
+      return error(new LispError("Missing slot " + slotName.princToString()));
     return slots[index];
   }
 
@@ -322,7 +322,7 @@
     int index = layout.getSlotIndex(slotName);
     //### FIXME: should call SLOT-MISSING (clhs)
     if (index < 0)
-      error(new LispError("Missing slot " + slotName.writeToString()));
+      error(new LispError("Missing slot " + slotName.princToString()));
     slots[index] = newValue;
   }
 

Modified: trunk/abcl/src/org/armedbear/lisp/StandardObjectFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardObjectFunctions.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StandardObjectFunctions.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -51,7 +51,7 @@
         if (arg.typep(StandardClass.STANDARD_CLASS) != NIL) {
             LispObject l = Symbol.CLASS_LAYOUT.execute(arg);
             if (! (l instanceof Layout))
-                return error(new ProgramError("Invalid standard class layout for: " + arg.writeToString()));
+                return error(new ProgramError("Invalid standard class layout for: " + arg.princToString()));
             
             return new StandardObject((Layout)l);
         }

Modified: trunk/abcl/src/org/armedbear/lisp/Stream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Stream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Stream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -576,7 +576,7 @@
             final int length = args.length();
             if ((length % 2) != 0)
                 return error(new ReaderError("Odd number of keyword arguments following #S: " +
-                                             obj.writeToString(),
+                                             obj.princToString(),
                                              this));
             LispObject[] array = new LispObject[length];
             LispObject rest = args;
@@ -594,7 +594,7 @@
                            thread);
         }
         return error(new ReaderError("Non-list following #S: " +
-                                     obj.writeToString(),
+                                     obj.princToString(),
                                      this));
     }
 
@@ -666,9 +666,9 @@
                         if (requireProperList) {
                             if (!obj.listp())
                                 error(new ReaderError("The value " +
-                                                      obj.writeToString() +
+                                                      obj.princToString() +
                                                       " is not of type " +
-                                                      Symbol.LIST.writeToString() + ".",
+                                                      Symbol.LIST.princToString() + ".",
                                                       this));
                         }
                         last.cdr = obj;
@@ -929,7 +929,7 @@
         case 1: {
             if (obj.listp() || obj instanceof AbstractVector)
                 return new SimpleVector(obj);
-            return error(new ReaderError(obj.writeToString() + " is not a sequence.",
+            return error(new ReaderError(obj.princToString() + " is not a sequence.",
                                          this));
         }
         default:
@@ -960,7 +960,7 @@
             sb.append(_getFilePosition());
         }
         sb.append(": #C");
-        sb.append(obj.writeToString());
+        sb.append(obj.printObject());
         return error(new ReaderError(sb.toString(), this));
     }
 
@@ -1619,7 +1619,7 @@
         final SpecialBindingsMark mark = thread.markSpecialBindings();
         thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
         try {
-            _writeString(obj.writeToString());
+            _writeString(obj.printObject());
         } finally {
             thread.resetSpecialBindings(mark);
         }
@@ -1671,7 +1671,7 @@
             }
             return number(arg.length());
         }
-        return error(new TypeError(arg.writeToString() +
+        return error(new TypeError(arg.princToString() +
                                    " is neither a string nor a character."));
     }
 
@@ -1971,23 +1971,23 @@
     }
 
     protected LispObject streamNotInputStream() {
-        return error(new StreamError(this, writeToString() + " is not an input stream."));
+        return error(new StreamError(this, princToString() + " is not an input stream."));
     }
 
     protected LispObject streamNotCharacterInputStream() {
-        return error(new StreamError(this, writeToString() + " is not a character input stream."));
+        return error(new StreamError(this, princToString() + " is not a character input stream."));
     }
 
     protected LispObject streamNotOutputStream() {
-        return error(new StreamError(this, writeToString() + " is not an output stream."));
+        return error(new StreamError(this, princToString() + " is not an output stream."));
     }
 
     protected LispObject streamNotBinaryOutputStream() {
-        return error(new StreamError(this, writeToString() + " is not a binary output stream."));
+        return error(new StreamError(this, princToString() + " is not a binary output stream."));
     }
 
     protected LispObject streamNotCharacterOutputStream() {
-        return error(new StreamError(this, writeToString() + " is not a character output stream."));
+        return error(new StreamError(this, princToString() + " is not a character output stream."));
     }
 
     // ### %stream-write-char character output-stream => character
@@ -2130,7 +2130,7 @@
             if (second == Keyword.ABORT)
                 return stream.close(third);
             return error(new ProgramError("Unrecognized keyword argument " +
-                                          second.writeToString() + "."));
+                                          second.princToString() + "."));
         }
     };
 

Modified: trunk/abcl/src/org/armedbear/lisp/StructureClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StructureClass.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StructureClass.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -72,14 +72,14 @@
     @Override
     public LispObject getDescription()
     {
-        return new SimpleString(writeToString());
+        return new SimpleString(princToString());
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer("#<STRUCTURE-CLASS ");
-        sb.append(getName().writeToString());
+        sb.append(getName().princToString());
         sb.append('>');
         return sb.toString();
     }

Modified: trunk/abcl/src/org/armedbear/lisp/StructureObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StructureObject.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/StructureObject.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -421,9 +421,9 @@
   private LispObject badIndex(int n)
   {
     StringBuilder sb = new StringBuilder("Invalid slot index ");
-    sb.append(Fixnum.getInstance(n).writeToString());
+    sb.append(Fixnum.getInstance(n).princToString());
     sb.append(" for ");
-    sb.append(writeToString());
+    sb.append(princToString());
     return error(new LispError(sb.toString()));
   }
 
@@ -449,7 +449,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     try
       {
@@ -464,7 +464,7 @@
             return stream.getString().getStringValue();
           }
         if (_PRINT_STRUCTURE_.symbolValue(thread) == NIL)
-          return unreadableString(structureClass.getName().writeToString());
+          return unreadableString(structureClass.getName().printObject());
         int maxLevel = Integer.MAX_VALUE;
         LispObject printLevel = Symbol.PRINT_LEVEL.symbolValue(thread);
         if (printLevel instanceof Fixnum)
@@ -475,7 +475,7 @@
         if (currentLevel >= maxLevel && slots.length > 0)
           return "#";
         StringBuilder sb = new StringBuilder("#S(");
-        sb.append(structureClass.getName().writeToString());
+        sb.append(structureClass.getName().printObject());
         if (currentLevel < maxLevel)
           {
             LispObject effectiveSlots = structureClass.getSlotDefinitions();
@@ -507,7 +507,7 @@
                     sb.append(stream.getString().getStringValue());
                   }
                 else
-                  sb.append(slots[i].writeToString());
+                  sb.append(slots[i].printObject());
               }
             if (limit < slots.length)
               sb.append(" ...");

Modified: trunk/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Symbol.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Symbol.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -130,7 +130,7 @@
     try
       {
         StringBuilder sb = new StringBuilder("The symbol ");
-        sb.append(name.writeToString());
+        sb.append(name.princToString());
         sb.append(" at #x");
         sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
         if (pkg instanceof Package)
@@ -300,7 +300,7 @@
   {
     if (isConstant())
       // Complement the check already done in SpecialOperators.sf_setq
-      error(new ProgramError("Can't change value of constant symbol " + writeToString() + "."));
+      error(new ProgramError("Can't change value of constant symbol " + princToString() + "."));
     this.value = value;
   }
 
@@ -445,7 +445,7 @@
   }
 
   @Override
-  public String writeToString()
+  public String printObject()
   {
     final String n = name.getStringValue();
     final LispThread thread = LispThread.currentThread();

Modified: trunk/abcl/src/org/armedbear/lisp/SynonymStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SynonymStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/SynonymStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -215,10 +215,10 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer("SYNONYM-STREAM ");
-        sb.append(symbol.writeToString());
+        sb.append(symbol.printObject());
         return unreadableString(sb.toString());
     }
 

Modified: trunk/abcl/src/org/armedbear/lisp/Throw.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Throw.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Throw.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -57,6 +57,6 @@
     public LispObject getCondition()
     {
         return new ControlError("Attempt to throw to the nonexistent tag " +
-                                tag.writeToString() + ".");
+                                tag.princToString() + ".");
     }
 }

Modified: trunk/abcl/src/org/armedbear/lisp/TwoWayStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/TwoWayStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/TwoWayStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -214,7 +214,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         return unreadableString(Symbol.TWO_WAY_STREAM);
     }

Modified: trunk/abcl/src/org/armedbear/lisp/TypeError.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/TypeError.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/TypeError.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -139,10 +139,10 @@
             final LispObject datum = getDatum();
             final LispObject expectedType = getExpectedType();
             StringBuilder sb = new StringBuilder();
-            String name = datum != null ? datum.writeToString() : null;
+            String name = datum != null ? datum.princToString() : null;
             String type = null;
             if (expectedType != null)
-                type = expectedType.writeToString();
+                type = expectedType.princToString();
             if (type != null) {
                 if (name != null) {
                     sb.append("The value ");

Modified: trunk/abcl/src/org/armedbear/lisp/URLStream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/URLStream.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/URLStream.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -135,10 +135,10 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         StringBuffer sb = new StringBuffer();
-        sb.append(Symbol.URL_STREAM.writeToString());
+        sb.append(Symbol.URL_STREAM.printObject());
         String namestring = pathname.getNamestring();
         if (namestring != null) {
             sb.append(" ");

Modified: trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -76,9 +76,9 @@
         thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
         try {
             StringBuilder sb = new StringBuilder("The slot ");
-            sb.append(getCellName().writeToString());
+            sb.append(getCellName().princToString());
             sb.append(" is unbound in the object ");
-            sb.append(getInstance().writeToString());
+            sb.append(getInstance().princToString());
             sb.append('.');
             return sb.toString();
         }

Modified: trunk/abcl/src/org/armedbear/lisp/UnboundVariable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/UnboundVariable.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/UnboundVariable.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -55,7 +55,7 @@
     thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
     StringBuffer sb = new StringBuffer("The variable ");
     try {
-        sb.append(getCellName().writeToString());
+        sb.append(getCellName().princToString());
     }
     finally {
         thread.resetSpecialBindings(mark);

Modified: trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -73,7 +73,7 @@
   public String getMessage()
   {
     StringBuilder sb = new StringBuilder("The function ");
-    sb.append(getCellName().writeToString());
+    sb.append(getCellName().princToString());
     sb.append(" is undefined.");
     return sb.toString();
   }

Modified: trunk/abcl/src/org/armedbear/lisp/Utilities.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Utilities.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/Utilities.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -104,7 +104,7 @@
         String namestring = merged.getNamestring();
         if (namestring != null)
             return new File(namestring);
-        error(new FileError("Pathname has no namestring: " + merged.writeToString(),
+        error(new FileError("Pathname has no namestring: " + merged.princToString(),
                              merged));
         // Not reached.
         return null;

Modified: trunk/abcl/src/org/armedbear/lisp/WeakHashTable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/WeakHashTable.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/WeakHashTable.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -315,14 +315,14 @@
     }
 
     @Override
-    public String writeToString() {
+    public String printObject() {
         if (Symbol.PRINT_READABLY.symbolValue(LispThread.currentThread()) != NIL) {
             error(new PrintNotReadable(list(Keyword.OBJECT, this)));
             return null; // Not reached.
         }
-        StringBuilder sb = new StringBuilder(getTest().writeToString());
+        StringBuilder sb = new StringBuilder(getTest().princToString());
         sb.append(' ');
-        sb.append(Symbol.HASH_TABLE.writeToString());
+        sb.append(Symbol.HASH_TABLE.princToString());
         sb.append(' ');
         if (bucketType instanceof HashEntryWeakKey) {
             sb.append("WEAKNESS :KEY");

Modified: trunk/abcl/src/org/armedbear/lisp/WeakReference.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/WeakReference.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/WeakReference.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -53,7 +53,7 @@
     }
 
     @Override
-    public String writeToString() {
+    public String printObject() {
         return unreadableString("WEAK-REFERENCE "
                 + toString());
     }

Modified: trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -76,7 +76,7 @@
         LispObject lambdaName = operator.getLambdaName();
         if (lambdaName != null && lambdaName != NIL) {
             sb.append(" for ");
-            sb.append(operator.getLambdaName().writeToString());
+            sb.append(operator.getLambdaName().princToString());
         }
 	if(expectedArgs >= 0) {
 	    sb.append("; ");

Modified: trunk/abcl/src/org/armedbear/lisp/ZeroRankArray.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ZeroRankArray.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/ZeroRankArray.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -134,7 +134,7 @@
     }
 
     @Override
-    public String writeToString()
+    public String printObject()
     {
         final LispThread thread = LispThread.currentThread();
         boolean printReadably = (Symbol.PRINT_READABLY.symbolValue(thread) != NIL);
@@ -153,14 +153,14 @@
                                data, stream);
                 sb.append(stream.getString().getStringValue());
             } else
-                sb.append(data.writeToString());
+                sb.append(data.printObject());
             return sb.toString();
         }
         StringBuffer sb = new StringBuffer();
         if (!adjustable)
             sb.append("SIMPLE-");
         sb.append("ARRAY ");
-        sb.append(elementType.writeToString());
+        sb.append(elementType.printObject());
         sb.append(" NIL");
         return unreadableString(sb.toString());
     }

Modified: trunk/abcl/src/org/armedbear/lisp/delete_file.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/delete_file.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/delete_file.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -65,7 +65,7 @@
                                     NIL);
         final String namestring = defaultedPathname.getNamestring();
         if (namestring == null)
-            return error(new FileError("Pathname has no namestring: " + defaultedPathname.writeToString(),
+            return error(new FileError("Pathname has no namestring: " + defaultedPathname.princToString(),
                                         defaultedPathname));
         final File file = new File(namestring);
 	ZipCache.remove(file);
@@ -80,7 +80,7 @@
             Pathname truename = new Pathname(file.getAbsolutePath());
             StringBuilder sb = new StringBuilder("Unable to delete ");
             sb.append(file.isDirectory() ? "directory " : "file ");
-            sb.append(truename.writeToString());
+            sb.append(truename.princToString());
             sb.append('.');
             return error(new FileError(sb.toString(), truename));
         } else {

Modified: trunk/abcl/src/org/armedbear/lisp/jclass_name.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/jclass_name.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/jclass_name.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -66,7 +66,7 @@
                 return new SimpleString(((Class)obj).getName());
             // Fall through.
         }
-        return error(new LispError(arg.writeToString() + " does not designate a Java class."));
+        return error(new LispError(arg.princToString() + " does not designate a Java class."));
     }
 
     // When called with two arguments, JCLASS-NAME tests whether CLASS-REF
@@ -88,7 +88,7 @@
                 className = ((Class)obj).getName();
         }
         if (className == null)
-            return error(new LispError(first.writeToString() + " does not designate a Java class."));
+            return error(new LispError(first.princToString() + " does not designate a Java class."));
         final AbstractString name = checkString(second);
         return LispThread.currentThread().setValues(name.getStringValue().equals(className) ? T : NIL,
                                                     new SimpleString(className));

Modified: trunk/abcl/src/org/armedbear/lisp/jmethod_return_type.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/jmethod_return_type.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/jmethod_return_type.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -55,7 +55,7 @@
             if (method instanceof Method)
             return new JavaObject(((Method)method).getReturnType());
         }
-        return error(new LispError(arg.writeToString() + " does not designate a Java method."));
+        return error(new LispError(arg.princToString() + " does not designate a Java method."));
     }
 
     private static final Primitive JMETHOD_RETURN_TYPE = new jmethod_return_type();

Modified: trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp	Fri Aug  5 14:25:10 2011	(r13440)
@@ -903,21 +903,22 @@
   (push attribute (method-attributes method))
   attribute)
 
-(defun method-add-code (method)
+(defun method-add-code (method &optional (optimize t))
   "Creates an (empty) 'Code' attribute for the method,
 returning the created attribute."
   (method-add-attribute
    method
    (make-code-attribute (+ (length (cdr (method-descriptor method)))
                            (if (member :static (method-access-flags method))
-                               0 1))))) ;; 1 == implicit 'this'
+                               0 1)) ;; 1 == implicit 'this'
+			optimize)))
 
-(defun method-ensure-code (method)
+(defun method-ensure-code (method &optional (optimize t))
   "Ensures the existence of a 'Code' attribute for the method,
 returning the attribute."
   (let ((code (method-attribute method "Code")))
     (if (null code)
-        (method-add-code method)
+        (method-add-code method optimize)
         code)))
 
 (defun method-attribute (method name)
@@ -1002,7 +1003,7 @@
 
   ;; labels contains offsets into the code array after it's finalized
   labels ;; an alist
-
+  optimize
   (current-local 0)) ;; used for handling nested WITH-CODE-TO-METHOD blocks
 
 
@@ -1026,7 +1027,7 @@
                      (nconc (mapcar #'exception-start-pc handlers)
                             (mapcar #'exception-end-pc handlers)
                             (mapcar #'exception-handler-pc handlers))
-                     t)))
+                     (code-optimize code))))
     (invoke-callbacks :code-finalized class parent
                       (coerce c 'list) handlers)
     (unless (code-max-stack code)
@@ -1086,10 +1087,10 @@
 
   (write-attributes (code-attributes code) stream))
 
-(defun make-code-attribute (arg-count)
+(defun make-code-attribute (arg-count &optional optimize)
   "Creates an empty 'Code' attribute for a method which takes
 `arg-count` parameters, including the implicit `this` parameter."
-  (%make-code-attribute :max-locals arg-count))
+  (%make-code-attribute :max-locals arg-count :optimize optimize))
 
 (defun code-add-attribute (code attribute)
   "Adds `attribute' to `code', returning `attribute'."
@@ -1192,20 +1193,24 @@
     `(progn
        (when *current-code-attribute*
          (save-code-specials *current-code-attribute*))
-       (let* ((,m ,method)
-              (*method* ,m)
-              (,c (method-ensure-code ,method))
-              (*pool* (class-file-constants ,class-file))
-              (*code* (code-code ,c))
-              (*registers-allocated* (code-max-locals ,c))
-              (*register* (code-current-local ,c))
-              (*current-code-attribute* ,c))
-         , at body
-         (setf (code-code ,c) *code*
-               (code-current-local ,c) *register*
-               (code-max-locals ,c) *registers-allocated*))
-       (when *current-code-attribute*
-         (restore-code-specials *current-code-attribute*)))))
+       (unwind-protect
+           (let* ((,m ,method)
+                  (*method* ,m)
+                  (,c (method-ensure-code ,method))
+                  (*pool* (class-file-constants ,class-file))
+                  (*code* (code-code ,c))
+                  (*registers-allocated* (code-max-locals ,c))
+                  (*register* (code-current-local ,c))
+                  (*current-code-attribute* ,c))
+             (unwind-protect
+                 , at body
+               ;; in case of a RETURN-FROM or GO, save the current state
+               (setf (code-code ,c) *code*
+                     (code-current-local ,c) *register*
+                     (code-max-locals ,c) *registers-allocated*)))
+         ;; using the same line of reasoning, restore the outer-scope state
+         (when *current-code-attribute*
+           (restore-code-specials *current-code-attribute*))))))
 
 
 (defstruct (source-file-attribute (:conc-name source-)

Modified: trunk/abcl/src/org/armedbear/lisp/zip.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/zip.java	Fri Aug  5 06:05:58 2011	(r13439)
+++ trunk/abcl/src/org/armedbear/lisp/zip.java	Fri Aug  5 14:25:10 2011	(r13440)
@@ -72,7 +72,7 @@
             String zipfileNamestring = zipfilePathname.getNamestring();
             if (zipfileNamestring == null)
                 return error(new SimpleError("Pathname has no namestring: " +
-                                              zipfilePathname.writeToString()));
+                                              zipfilePathname.princToString()));
             ZipOutputStream out =
                 new ZipOutputStream(new FileOutputStream(zipfileNamestring));
             LispObject list = second;
@@ -85,7 +85,7 @@
                     File zipfile = new File(zipfileNamestring);
                     zipfile.delete();
                     return error(new SimpleError("Pathname has no namestring: "
-                                                 + pathname.writeToString()));
+                                                 + pathname.princToString()));
                 }
                 File file = new File(namestring);
                 makeEntry(out, file);
@@ -109,7 +109,7 @@
             String zipfileNamestring = zipfilePathname.getNamestring();
             if (zipfileNamestring == null)
                 return error(new SimpleError("Pathname has no namestring: " +
-                                              zipfilePathname.writeToString()));
+                                              zipfilePathname.princToString()));
             ZipOutputStream out =
                 new ZipOutputStream(new FileOutputStream(zipfileNamestring));
             Pathname root = (Pathname) Pathname.truename(coerceToPathname(third));
@@ -126,7 +126,7 @@
                     File zipfile = new File(zipfileNamestring);
                     zipfile.delete();
                     return error(new SimpleError("Pathname has no namestring: " +
-                                                  pathname.writeToString()));
+                                                  pathname.princToString()));
                 }
                 String directory = "";
                 String dir = pathname.getDirectoryNamestring();
@@ -199,7 +199,7 @@
         String zipfileNamestring = zipfilePathname.getNamestring();
         if (zipfileNamestring == null)
             return error(new SimpleError("Pathname has no namestring: " +
-                                         zipfilePathname.writeToString()));
+                                         zipfilePathname.princToString()));
         ZipOutputStream out = null;
         try {
             out = new ZipOutputStream(new FileOutputStream(zipfileNamestring));




More information about the armedbear-cvs mailing list