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

Erik Huelsmann ehuelsmann at common-lisp.net
Sun May 23 09:31:34 UTC 2010


Author: ehuelsmann
Date: Sun May 23 05:31:32 2010
New Revision: 12723

Log:
Style nit: I like tables and loops for their compactness.

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 May 23 05:31:32 2010
@@ -430,6 +430,12 @@
                                       in, verbose, print, auto, false);
     }
 
+    private static Symbol[] savedSpecials =
+        new Symbol[] { // CLHS Specified
+                       Symbol.CURRENT_READTABLE, Symbol._PACKAGE_,
+                       // Compiler policy
+                       _SPEED_, _SPACE_, _SAFETY_, _DEBUG_, _EXPLAIN_ };
+
     // A nil TRUENAME signals a load from stream which has no possible path
     private static final LispObject loadFileFromStream(LispObject pathname,
                                                        LispObject truename,
@@ -443,18 +449,12 @@
         long start = System.currentTimeMillis();
         final LispThread thread = LispThread.currentThread();
         final SpecialBindingsMark mark = thread.markSpecialBindings();
-        // "LOAD binds *READTABLE* and *PACKAGE* to the values they held before
-        // loading the file."
-        thread.bindSpecialToCurrentValue(Symbol.CURRENT_READTABLE);
-        thread.bindSpecialToCurrentValue(Symbol._PACKAGE_);
+
+        for (Symbol special : savedSpecials)
+            thread.bindSpecialToCurrentValue(special);
+
         int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue(thread));
         thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth));
-        // Compiler policy.
-        thread.bindSpecialToCurrentValue(_SPEED_);
-        thread.bindSpecialToCurrentValue(_SPACE_);
-        thread.bindSpecialToCurrentValue(_SAFETY_);
-        thread.bindSpecialToCurrentValue(_DEBUG_);
-        thread.bindSpecialToCurrentValue(_EXPLAIN_);
         final String prefix = getLoadVerbosePrefix(loadDepth);
         try {
             thread.bindSpecial(Symbol.LOAD_PATHNAME, pathname);




More information about the armedbear-cvs mailing list