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

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Tue Jul 31 18:10:04 UTC 2012


Author: ehuelsmann
Date: Tue Jul 31 11:10:03 2012
New Revision: 14033

Log:
Make MACROEXPAND-1 auto-load strictly what it needs (macro functions)
instead of auto-loading all function types.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	Tue Jul 31 11:06:59 2012	(r14032)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Tue Jul 31 11:10:03 2012	(r14033)
@@ -223,8 +223,11 @@
         if (car instanceof Symbol)
           {
             LispObject obj = env.lookupFunction(car);
-            if (obj instanceof Autoload)
+            if (obj instanceof AutoloadMacro)
               {
+                // Don't autoload function objects here:
+                // we want that to happen upon the first use.
+                // in case of macro functions, this *is* the first use.
                 Autoload autoload = (Autoload) obj;
                 autoload.load();
                 obj = car.getSymbolFunction();
@@ -1808,6 +1811,15 @@
       }
     else if (obj instanceof Cons && obj.car() == Symbol.LAMBDA)
       return new Closure(obj, new Environment());
+    if (obj instanceof Cons && obj.car() == Symbol.NAMED_LAMBDA) {
+        LispObject name = obj.cadr();
+        if (name instanceof Symbol || isValidSetfFunctionName(name)) {
+            return new Closure(name,
+                               new Cons(Symbol.LAMBDA, obj.cddr()),
+                               new Environment());
+        }
+        return type_error(name, FUNCTION_NAME);
+    }
     error(new UndefinedFunction(obj));
     // Not reached.
     return null;




More information about the armedbear-cvs mailing list