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

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Thu Sep 11 22:08:02 UTC 2008


Author: ehuelsmann
Date: Thu Sep 11 18:07:58 2008
New Revision: 11309

Modified:
   trunk/j/src/org/armedbear/lisp/Closure.java
Log:
Use bindArg everywhere where it's applicable; fixes handler-case.29 (free declaration scope).

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 Sep 11 18:07:58 2008
@@ -432,18 +432,13 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, arg, ext);
+        bindArg(requiredParameters[0].var, arg, ext, thread);
         if (arity != 1)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -481,19 +476,14 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
         if (arity != 2)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -533,20 +523,15 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
-        bind(requiredParameters[2].var, third, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
+        bindArg(requiredParameters[2].var, third, ext, thread);
         if (arity != 3)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -587,21 +572,16 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
-        bind(requiredParameters[2].var, third, ext);
-        bind(requiredParameters[3].var, fourth, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
+        bindArg(requiredParameters[2].var, third, ext, thread);
+        bindArg(requiredParameters[3].var, fourth, ext, thread);
         if (arity != 4)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -644,22 +624,17 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
-        bind(requiredParameters[2].var, third, ext);
-        bind(requiredParameters[3].var, fourth, ext);
-        bind(requiredParameters[4].var, fifth, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
+        bindArg(requiredParameters[2].var, third, ext, thread);
+        bindArg(requiredParameters[3].var, fourth, ext, thread);
+        bindArg(requiredParameters[4].var, fifth, ext, thread);
         if (arity != 5)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -703,23 +678,18 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
-        bind(requiredParameters[2].var, third, ext);
-        bind(requiredParameters[3].var, fourth, ext);
-        bind(requiredParameters[4].var, fifth, ext);
-        bind(requiredParameters[5].var, sixth, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
+        bindArg(requiredParameters[2].var, third, ext, thread);
+        bindArg(requiredParameters[3].var, fourth, ext, thread);
+        bindArg(requiredParameters[4].var, fifth, ext, thread);
+        bindArg(requiredParameters[5].var, sixth, ext, thread);
         if (arity != 6)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -765,24 +735,19 @@
         final LispThread thread = LispThread.currentThread();
         SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
         Environment ext = new Environment(environment);
-        if (specials != null)
-          {
-            for (int i = 0; i < specials.length; i++)
-              ext.declareSpecial(specials[i]);
-          }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
-        bind(requiredParameters[2].var, third, ext);
-        bind(requiredParameters[3].var, fourth, ext);
-        bind(requiredParameters[4].var, fifth, ext);
-        bind(requiredParameters[5].var, sixth, ext);
-        bind(requiredParameters[6].var, seventh, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
+        bindArg(requiredParameters[2].var, third, ext, thread);
+        bindArg(requiredParameters[3].var, fourth, ext, thread);
+        bindArg(requiredParameters[4].var, fifth, ext, thread);
+        bindArg(requiredParameters[5].var, sixth, ext, thread);
+        bindArg(requiredParameters[6].var, seventh, ext, thread);
         if (arity != 7)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }
@@ -834,20 +799,20 @@
             for (int i = 0; i < specials.length; i++)
               ext.declareSpecial(specials[i]);
           }
-        bind(requiredParameters[0].var, first, ext);
-        bind(requiredParameters[1].var, second, ext);
-        bind(requiredParameters[2].var, third, ext);
-        bind(requiredParameters[3].var, fourth, ext);
-        bind(requiredParameters[4].var, fifth, ext);
-        bind(requiredParameters[5].var, sixth, ext);
-        bind(requiredParameters[6].var, seventh, ext);
-        bind(requiredParameters[7].var, eighth, ext);
+        bindArg(requiredParameters[0].var, first, ext, thread);
+        bindArg(requiredParameters[1].var, second, ext, thread);
+        bindArg(requiredParameters[2].var, third, ext, thread);
+        bindArg(requiredParameters[3].var, fourth, ext, thread);
+        bindArg(requiredParameters[4].var, fifth, ext, thread);
+        bindArg(requiredParameters[5].var, sixth, ext, thread);
+        bindArg(requiredParameters[6].var, seventh, ext, thread);
+        bindArg(requiredParameters[7].var, eighth, ext, thread);
         if (arity != 8)
           {
             if (optionalParameters != null)
               bindOptionalParameterDefaults(ext, thread);
             if (restVar != null)
-              bind(restVar, NIL, ext);
+                bindArg(restVar, NIL, ext, thread);
             if (keywordParameters != null)
               bindKeywordParameterDefaults(ext, thread);
           }



More information about the armedbear-cvs mailing list