[Swift-devel] iterate behavior

Mihael Hategan hategan at mcs.anl.gov
Tue Jul 5 15:43:04 CDT 2011


Ok. This is how it works in trunk now.

On Tue, 2011-07-05 at 14:15 -0500, Jonathan Monette wrote:
> that is how I would read the iterate statement.
> 
> On Jul 5, 2011, at 2:12 PM, Mihael Hategan wrote:
> 
> > On Tue, 2011-07-05 at 13:53 -0500, Jonathan Monette wrote:
> >> I do not think it should be like that.  I understand why it would do that.  The java code for that would be:
> >> 
> >> int i = 0;
> >> do
> >> {
> >>    System.out.println( i );
> >> } while( i++ <= 2 );
> >> 
> >> but in my opinion the increment of i should be done before the check.
> > 
> > Smells right to me. I think that the while/until at the end suggests
> > that the test is the latest thing to happen in an iteration (i.e. after
> > the increment).
> > 
> > 
> 





More information about the Swift-devel mailing list