[armedbear-cvs] r11334 - trunk/j/src/org/armedbear/lisp

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Thu Oct 2 21:26:11 UTC 2008


Author: ehuelsmann
Date: Thu Oct  2 17:26:10 2008
New Revision: 11334

Modified:
   trunk/j/src/org/armedbear/lisp/Closure.java
Log:
Cleanup patch.

Patch by: Ville Voutilainen.

Modified: trunk/j/src/org/armedbear/lisp/Closure.java
==============================================================================
--- trunk/j/src/org/armedbear/lisp/Closure.java	(original)
+++ trunk/j/src/org/armedbear/lisp/Closure.java	Thu Oct  2 17:26:10 2008
@@ -291,18 +291,12 @@
     specials = processDeclarations();
   }
 
-  // Also sets bindInitForms.
-  private final Symbol[] processVariables()
+  private final void processParameters(ArrayList<Symbol> vars,
+				  final Parameter[] parameters)
   {
-    ArrayList<Symbol> vars = new ArrayList<Symbol>();
-    if (requiredParameters != null)
-      {
-        for (Parameter parameter : requiredParameters)
-          vars.add(parameter.var);
-      }
-    if (optionalParameters != null)
+    if (parameters != null)
       {
-        for (Parameter parameter : optionalParameters)
+        for (Parameter parameter : parameters)
           {
             vars.add(parameter.var);
             if (parameter.svar != NIL)
@@ -312,22 +306,23 @@
                 bindInitForms = true;
           }
       }
-    if (restVar != null)
+  }
+
+  // Also sets bindInitForms.
+  private final Symbol[] processVariables()
+  {
+    ArrayList<Symbol> vars = new ArrayList<Symbol>();
+    if (requiredParameters != null)
       {
-        vars.add(restVar);
+        for (Parameter parameter : requiredParameters)
+          vars.add(parameter.var);
       }
-    if (keywordParameters != null)
+    processParameters(vars, optionalParameters);
+    if (restVar != null)
       {
-        for (Parameter parameter : keywordParameters)
-          {
-            vars.add(parameter.var);
-            if (parameter.svar != NIL)
-              vars.add((Symbol)parameter.svar);
-            if (!bindInitForms)
-              if (!parameter.initForm.constantp())
-                bindInitForms = true;
-          }
+        vars.add(restVar);
       }
+    processParameters(vars, keywordParameters);
     Symbol[] array = new Symbol[vars.size()];
     vars.toArray(array);
     return array;



More information about the armedbear-cvs mailing list