<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I see your points and agree that this is a small feature. My thinking was that it can be added to the standard library pretty easily just because of this without real disadvantages – but it may of course not pay for itself and maybe even cause confusion.<div class=""><br class=""></div><div class="">As I stated earlier implementing the method also is about what the standard library <i class="">should</i> be and what it <i class="">should not</i>. I learned more about it now and understand that the suggested method may not be appropriate for it. I will probably stick with libraries for a `times` method in the future then.</div><div class=""><div class=""><div class=""><br class=""></div><div class="">Thank you very much Radek, Chris and the others for your feedback and consideration!<br class=""><div class=""><br class=""></div><div class="">– Cihat</div></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">Am 18.12.2015 um 21:37 schrieb Chris Lattner <<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Dec 18, 2015, at 12:32 PM, Radosław Pietruszewski <<a href="mailto:radexpl@gmail.com" class="">radexpl@gmail.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class=""><br class="">My personal opinion on this is that 5.times { stuff} offers no benefits over “repeat 5 { stuff }”, so I’d rather see the later (if anything).<br class=""><br class="">This is all shades of gray with no clear answer. We generally want to have standard APIs pay for themselves and avoid confusion. I agree with DaveA’s points upthread. If you contrast it with forEach, forEach (barely!) pays for itself by allowing things like:<br class=""><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>collection.forEach(curriedMethod)<br class=""><br class="">That benefit doesn’t translate to “.times".<br class=""><br class="">-Chris<br class=""></blockquote><br class="">Thanks for weighing in!<br class=""><br class="">The benefit of `5.times` vs `repeat 5` is that the former is (and can easily be) defined in Swift, not as a language-level feature. OTOH `repeat 5` is a bit more useful because it allows returning/breaking/etc.<br class=""><br class="">But I also understand the argument that this feature isn’t worth it at all. (There’s already a lot of libraries extending stdlib with things of this sort!)<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">It’s important to differentiate “not interesting” vs “not appropriate to include in the swift standard library”. I love that you can express things like that directly in the language, and if someone felt compelled to do that in their own code (or in a SPM package someday) that would be fine with me. It just shouldn’t (again, IMO) come with swift out of the box.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Chris</span></div></blockquote></div><br class=""></div></div></body></html>