On Thu, Dec 31, 2015 at 3:51 PM, Tino Heth <[email protected]> wrote:
>> Those are collections. Collections can be iterated over multiple times.
> Speaking of the Fibonacci-numbers:
> Sure we can write an algorithm that iterates over them several times — it
> just won't ever finish the first iteration ;-)
> (only nitpicking — I just couldn't resist)
Well, I didn't say you need to iterate to the very end, or that you
need to iterate them serially. You can take two generators from the
same collection, and advance them independently, in interleaved
fashion, for example.
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]>*/
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution