This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for ListPat.java


Hi,

Here is a patch for kawa/lang/ListPat.java. The original code did not return
false when there was more than the maximum number of elements in the target
list. Because of this, expressions like

(set! x 1 2 3 4)
(try-finally 1 2 3 4)

were perfectly valid, making a few things really hard to debug ;-)

Dominique Boucher

Index: kawa/lang/ListPat.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/lang/ListPat.java,v
retrieving revision 1.8
diff -u -w -r1.8 ListPat.java
--- kawa/lang/ListPat.java      15 Jun 2003 02:19:05 -0000      1.8
+++ kawa/lang/ListPat.java      19 Aug 2004 18:54:30 -0000
@@ -33,6 +33,10 @@
        else
          break;
       }
+
+    if (i == max && (obj instanceof Pair))
+        return false;
+
     for ( ; i < max; i++)
       vars[start_vars + i] = default_val;
     return true;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]