[swift-evolution] Proposal: Add .times method to Integer type
Brent Royal-Gordon
brent at architechies.com
Sat Dec 19 18:35:38 CST 2015
> I do have an honest question that comes from ignorance rather than malice: has anyone actually used .times in ruby outside of the context of learning or testing?
I've seen it used to retry a failing operation a certain number of times:
5.times do
return true if do_network_call
sleep 5
end
raise NetworkCallFailedError
Of course, that requires you to be able to return out of the surrounding function from the `times` loop, which you can do in Ruby but not in Swift.
--
Brent Royal-Gordon
Architechies
More information about the swift-evolution
mailing list