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

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Jun 20 20:38:09 UTC 2010


Author: ehuelsmann
Date: Sun Jun 20 16:38:08 2010
New Revision: 12760

Log:
Remove separate FaslVersionMismatch exception in favor of
raising a lispy error directly.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Load.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Load.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Load.java	Sun Jun 20 16:38:08 2010
@@ -198,12 +198,6 @@
                                       new Stream(Symbol.SYSTEM_STREAM, in, Symbol.CHARACTER),
                                       verbose, print, false, returnLastResult);
         }
-        catch (FaslVersionMismatch e) {
-            StringBuilder sb =
-                new StringBuilder("Incorrect fasl version: ");
-            sb.append(truename);
-            return error(new SimpleError(sb.toString()));
-        }
         finally {
             if (in != null) {
                 try {
@@ -328,11 +322,6 @@
                 Stream stream = new Stream(Symbol.SYSTEM_STREAM, in, Symbol.CHARACTER);
                 return loadFileFromStream(pathname, truename, stream,
                                           verbose, print, auto);
-            } catch (FaslVersionMismatch e) {
-                StringBuilder sb =
-                    new StringBuilder("; Incorrect fasl version: ");
-                sb.append(truename);
-                System.err.println(sb.toString());
             } finally {
                 thread.resetSpecialBindings(mark);
                 try {
@@ -407,16 +396,21 @@
         public LispObject execute(LispObject first, LispObject second)
 
         {
+            final LispThread thread = LispThread.currentThread();
             if (first == Keyword.VERSION) {
                 if (second.eql(_FASL_VERSION_.getSymbolValue())) {
                     // OK
-                    final LispThread thread = LispThread.currentThread();
                     thread.bindSpecial(_FASL_UNINTERNED_SYMBOLS_, NIL);
                     thread.bindSpecial(_SOURCE_, NIL);
                     return faslLoadStream(thread);
                 }
             }
-            throw new FaslVersionMismatch(second);
+            return
+                error(new SimpleError("FASL version mismatch; found '"
+                        + second.writeToString() + "' but expected '"
+                        + _FASL_VERSION_.getSymbolValue().writeToString()
+                        + "' in "
+                        + Symbol.LOAD_PATHNAME.symbolValue(thread).writeToString()));
         }
     }
 
@@ -700,19 +694,4 @@
                                   false);
         }
     }
-
-    private static class FaslVersionMismatch extends Error
-    {
-        private final LispObject version;
-
-        public FaslVersionMismatch(LispObject version)
-        {
-            this.version = version;
-        }
-
-        public LispObject getVersion()
-        {
-            return version;
-        }
-    }
 }




More information about the armedbear-cvs mailing list