Bug in do loop conditions?

From: Warwick Harvey <wh_at_icparc.ic.ac.uk>
Date: Thu 20 Sep 2001 06:47:12 PM GMT
Message-ID: <20010920194712.G17839@tempest.icparc.ic.ac.uk>
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,
Warwick
Received 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