Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-20 Thread Howard Lovatt via swift-evolution
+1 to 5.times{stuff} from me. I much prefer library functions to language extensions. -- Howard. ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-20 Thread T.J. Usiyan via swift-evolution
-1 from me. It is simple enough for an extension and provides little benefit as a standard library inclusion. On Sun, Dec 20, 2015 at 9:10 PM, Howard Lovatt via swift-evolution < swift-evolution@swift.org> wrote: > +1 to 5.times{stuff} from me. I much prefer library functions to language >

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-20 Thread Félix Cloutier via swift-evolution
The Foundation framework is being ported to other platforms and it has CGSize and NSDate (but not NSImage/UIImage). For the rest, the Swift package manager will probably fulfill that role, no?

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-19 Thread Andrew Hoos via swift-evolution
Summary of feedback Cons Block based API prevents return/break/continue Can be implemented by an extension without language changes Vaguely confusable with multiplication Pros Is easier for new learners Removes ambiguity of ..< vs ... (again mostly new learners) shorter than existing syntax

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-19 Thread Brent Royal-Gordon via swift-evolution
> 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

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-18 Thread Dave Abrahams via swift-evolution
-1 from me, if nothing else because the name is confusable with multiplication in the context of integers. > On Dec 18, 2015, at 11:53 AM, Jacob Bandes-Storch via swift-evolution > wrote: > > I like how clean "100.times { doSomething() }" looks, but I'm concerned

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-18 Thread Etan Kissling via swift-evolution
You don't need stride for this. func foo() { (0..<5_000).forEach { _ in print("asdf") } } On 18 Dec 2015, at 19:25, Cihat Gündüz via swift-evolution > wrote: Dear Swift-Community, I’d like to

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-18 Thread Cihat Gündüz via swift-evolution
> Am 18.12.2015 um 21:02 schrieb Dave Abrahams : > > -1 from me, if nothing else because the name is confusable with > multiplication in the context of integers. Isn’t it a multiplication? A multiplication of the closure specified? I see it as such. Also I don’t think

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-18 Thread Radosław Pietruszewski via swift-evolution
> But isn’t that more a sign that Swift needs a way to make closures more > useful by adding the possibility of breaking/continueing/returning from > within them rather than a disadvantage of the `times`-syntax itself? Perhaps — there’s a thread, somewhere, with possible solutions to this.

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-18 Thread Chris Lattner via swift-evolution
> On Dec 18, 2015, at 12:32 PM, Radosław Pietruszewski > wrote: > >> >> 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). >> >> This is all shades of gray with no clear answer.

Re: [swift-evolution] Proposal: Add .times method to Integer type

2015-12-18 Thread Cihat Gündüz via swift-evolution
I agree with Radek. I find `for i in 5 { doSomething() }` or `for 5 { doSomething() }` to be very confusing since it is neither close to human language nor to any common programming language I know of. I like the idea of giving students a step by step introduction into things, but this is IMO