This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Patch for ListPat.java
- From: "Dominique Boucher" <dominique dot boucher at nuecho dot com>
- To: "'Kawa List'" <kawa at sources dot redhat dot com>
- Date: Thu, 19 Aug 2004 15:06:03 -0400
- Subject: Patch for ListPat.java
- Reply-to: <dominique dot boucher at nuecho dot com>
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;