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

Alessio Stalla astalla at common-lisp.net
Tue Nov 3 21:49:31 UTC 2009


Author: astalla
Date: Tue Nov  3 16:49:29 2009
New Revision: 12244

Log:
Implemented AbstractString.toString() returning the Java string for nicer printing in Java


Modified:
   trunk/abcl/src/org/armedbear/lisp/AbstractString.java

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractString.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractString.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractString.java	Tue Nov  3 16:49:29 2009
@@ -118,4 +118,18 @@
     {
         return writeToString(0, length());
     }
+
+    public String toString() {
+	try {
+	    int length = length();
+	    StringBuilder sb = new StringBuilder(length);
+	    for(int i = 0; i < length; ++i) {
+		sb.append(charAt(i));
+	    }
+	    return sb.toString();
+	} catch(ConditionThrowable t) {
+	    throw new Error(t); //Should never happen
+	}
+    }
+
 }




More information about the armedbear-cvs mailing list