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]

Re: for-each does not compile in CVS tree


Emmanuel Castro <castro@lirmm.fr> writes:

> The new inlined version of for-each does not work properly when compiled
> 
> In fact, it does nothing. I don't know why.

Ouch.  The problem was easy to find, but it is embarassing that
testing didn't catch it.  I'm not quite sure why.

Anyway, I've checked the following patch in.

2000-12-13  Per Bothner  <per@bothner.com>

	* kawa/standard/map.java (inline):  Swap order of then-clause and
	else-clause in generated code.  Fixes bug 'for-each does not compile
	in CVS tree' reported by Emmanuel Castro <castro@lirmm.fr>.

Index: map.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/standard/map.java,v
retrieving revision 1.4
diff -u -r1.4 map.java
--- map.java	2000/12/12 06:50:43	1.4
+++ map.java	2000/12/13 16:15:48
@@ -166,7 +166,7 @@
 	compArgs[0] = new ReferenceExp(largs[i]);
 	compArgs[1] = empty;
 	lexp.body = new IfExp(new ApplyExp(isEq, compArgs),
-			      lexp.body, QuoteExp.voidExp);
+			      QuoteExp.voidExp, lexp.body);
 	initArgs[i] = args[i+1];
       }
 

-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

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