[armedbear-cvs] r12241 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Mon Nov 2 20:40:38 UTC 2009
Author: ehuelsmann
Date: Mon Nov 2 15:40:35 2009
New Revision: 12241
Log:
Document getStringValue() to return the string value from string designators.
Change string designators (Symbol, LispCharacter) to return a value too.
Modified:
trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
trunk/abcl/src/org/armedbear/lisp/LispObject.java
trunk/abcl/src/org/armedbear/lisp/Symbol.java
Modified: trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispCharacter.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/LispCharacter.java Mon Nov 2 15:40:35 2009
@@ -226,6 +226,13 @@
return Character.toUpperCase(value);
}
+ /** See LispObject.getStringValue() */
+ @Override
+ public String getStringValue() throws ConditionThrowable
+ {
+ return String.valueOf(value);
+ }
+
@Override
public final String writeToString() throws ConditionThrowable
{
Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java Mon Nov 2 15:40:35 2009
@@ -1062,6 +1062,11 @@
return null;
}
+ /** Returns a string representing the value
+ * of a 'string designator', if the instance is one.
+ *
+ * Throws an error if the instance isn't a string designator.
+ */
public String getStringValue() throws ConditionThrowable
{
type_error(this, Symbol.STRING);
Modified: trunk/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Symbol.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/Symbol.java Mon Nov 2 15:40:35 2009
@@ -420,6 +420,13 @@
this.function = obj;
}
+ /** See LispObject.getStringValue() */
+ @Override
+ public String getStringValue() throws ConditionThrowable
+ {
+ return name.getStringValue();
+ }
+
@Override
public final LispObject getPropertyList()
{
More information about the armedbear-cvs
mailing list