On Fri, Apr 8, 2016 at 3:49 AM, Vladimir.S <sva...@gmail.com> wrote: > > > On 07.04.2016 21:43, Dmitri Gribenko wrote: >> >> There would be no need to. Collection will have a .successor(of:) >> method that returns the next index after the given one. >> > > I see. Thank you for letting know about this. > >> I can see that, but when you know that you are dealing with an >> integer, isn't "+ 1" a more common and readable notation? > > > Hmm.. I believe that i++ is muuuch common used than i += 1 ;-)
The reason why I said "+ 1" is because this discussion is about Int.successor(), which returns a new Int rather than mutating it in place. So i++ and i += 1 are not direct replacements for Int.successor(). 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 <griboz...@gmail.com>*/ _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution