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

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Sun Jan 29 21:15:49 UTC 2012


Author: ehuelsmann
Date: Sun Jan 29 13:15:48 2012
New Revision: 13823

Log:
Add an ArgumentListProcessor to Closure. It'll take over
argument list processing soon.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Closure.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Closure.java	Sun Jan 29 13:14:42 2012	(r13822)
+++ trunk/abcl/src/org/armedbear/lisp/Closure.java	Sun Jan 29 13:15:48 2012	(r13823)
@@ -76,6 +76,8 @@
   private boolean bindInitForms;
 
 
+  private ArgumentListProcessor arglist;
+
     /** Construct a closure object with a lambda-list described
      * by these parameters.
      *
@@ -115,6 +117,26 @@
       body = null;
       executionBody = null;
       environment = null;
+
+      ArrayList<ArgumentListProcessor.RequiredParam> reqParams =
+              new ArrayList<ArgumentListProcessor.RequiredParam>();
+      for (Parameter req : requiredParameters)
+          reqParams.add(new ArgumentListProcessor.RequiredParam(req.var, false));
+
+      ArrayList<ArgumentListProcessor.OptionalParam> optParams =
+              new ArrayList<ArgumentListProcessor.OptionalParam>();
+      for (Parameter opt : optionalParameters)
+          optParams.add(new ArgumentListProcessor.OptionalParam(opt.var, false,
+                  (opt.svar == NIL) ? null : (Symbol)opt.svar, false,
+                  opt.initForm));
+
+      ArrayList<ArgumentListProcessor.KeywordParam> keyParams =
+              new ArrayList<ArgumentListProcessor.KeywordParam>();
+      for (Parameter key : keywordParameters)
+          keyParams.add(new ArgumentListProcessor.KeywordParam(key.var, false,
+                  (key.svar == NIL) ? null : (Symbol)key.svar, false, key.initForm,
+                  key.keyword));
+      arglist = new ArgumentListProcessor(this, reqParams, optParams, keyParams, andKey, allowOtherKeys, restVar);
   }
 
 
@@ -351,6 +373,8 @@
     if (arity >= 0)
       Debug.assertTrue(arity == minArgs);
     variables = processVariables();
+
+    arglist = new ArgumentListProcessor(this, lambdaList, specials);
   }
 
   private final void processParameters(ArrayList<Symbol> vars,




More information about the armedbear-cvs mailing list