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

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Jan 22 22:56:33 UTC 2011


Author: ehuelsmann
Date: Sat Jan 22 17:55:38 2011
New Revision: 13178

Log:
Fix problem found by Blake McBride while running SCONE.

Note: the problem was that SCONE tries to bind a symbol
named 1s2f, which was interpreted as a number by ABCL.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Stream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Stream.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Stream.java	Sat Jan 22 17:55:38 2011
@@ -1329,7 +1329,6 @@
 
     private static final LispObject makeFloat(final String token,
             final int length)
-
     {
         if (length == 0)
             return null;
@@ -1377,6 +1376,13 @@
             return null;
         // Append rest of token.
         sb.append(token.substring(i));
+        c = sb.charAt(sb.length()-1);
+        if (! ('0' <= c && c <= '9'))
+            // we need to check that the last item is a number:
+            // the Double.parseDouble routine accepts numbers ending in 'D'
+            // like 1e2d. The same is true for Float.parseFloat and the 'F'
+            // character. However, these are not valid Lisp floats.
+            return null;
         try {
             if (marker == 0) {
                 LispObject format = Symbol.READ_DEFAULT_FLOAT_FORMAT.symbolValue();




More information about the armedbear-cvs mailing list