[Swift-devel] iterate behavior
    Jonathan Monette 
    jonmon at utexas.edu
       
    Tue Jul  5 14:15:26 CDT 2011
    
    
  
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