I guess I am not in the forloopian camp. I spend far too much time, converting 
for i = 0; i < 4; i++) into something more modern like iterating over 
containers. If it is in the language, people will use it, not having it there 
makes people think about better ways of doing things rather than relying on 
muscle memory. I know it is a barrier for some but other languages such as 
Python don’t support this construct and no one will deny that Python is heavily 
used in numerics. 

- Paul

> On Mar 19, 2016, at 1:28 AM, ted van gaalen via swift-evolution 
> <[email protected]> wrote:
> 
> Yes, thank you Dmitri, I think so too.
> Will come back to this later.
> TedvG
> 
> 
> 
> ted van gaalen
> 
> On 19 Mar 2016, at 08:46, Dmitri Gribenko <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>> Hi Ted,
>> 
>> Thank you for starting this thread.  I agree that removing the C-style
>> for loop has degraded the readability and clarity of some of numerics
>> code.
>> 
>> In the feedback to SE-0007 many people have said that they can convert
>> their code to for-in loops, but I think this actually means that in
>> code that is typically written in Swift today, loops primarily operate
>> on sequences and collections.  It means that numerics is a domain that
>> not many people work in.  But it is a very important domain
>> nevertheless, and clarity for numerics code matters at least as much
>> as it does everywhere else.
>> 
>> I think one way to approach this discussion would be to present
>> multiple concrete code samples that contain C-style for loops and are
>> awkward to write without them.  We can then try looking for patterns,
>> generalize and simplify, and discuss possible solutions.
>> 
>> Dmitri
>> 
>> -- 
>> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
>> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected] 
>> <mailto:[email protected]>>*/
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to