There appears to be a bug with regard to counting conditions in do loops. I would have assumed that if I had `for(I, 1, 3)' as a condition for a do loop, the loop would not have iterated more than 3 times. This is not the case, as shown in the example below. The same thing happens using `count' instead of `for', and using a `fromto' instead of a `foreach'. ECLiPSe Constraint Logic Programming System [kernel] Copyright Imperial College London and ICL Certain libraries copyright Parc Technologies Ltd GMP library copyright Free Software Foundation Version 5.3 #15, Mon Sep 10 00:14 2001 [eclipse 1]: ( for(I, 1, 3) do writeln(I) ). 1 2 3 I = I Yes (0.00s cpu) [eclipse 2]: length(L, 5), ( for(I, 1, 3), foreach(_, L) do writeln(I) ). 1 2 3 4 5 No (0.00s cpu) [eclipse 3]: Cheers, WarwickReceived on Thu Sep 20 19:47:12 2001
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:10 PM GMT GMT