Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-28 Thread Christopher Kornher via swift-evolution
> On Jun 27, 2016, at 11:52 PM, Charlie Monroe via swift-evolution > wrote: > > >> On Jun 27, 2016, at 9:10 PM, Christopher Kornher > > wrote: >> >> >>> On Jun 26, 2016, at 11:22 PM, Charlie Monroe via swift-evolution

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-28 Thread Christopher Kornher via swift-evolution
> On Jun 28, 2016, at 6:53 AM, ad...@wheerd.de wrote: > > Am 27.06.2016 20:55, schrieb Christopher Kornher: >>> On Jun 27, 2016, at 2:45 AM, Manuel Krebber via swift-evolution >>> wrote: >>> On 06/26/2016 09:10 PM, Christopher Kornher via swift-evolution wrote:

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-28 Thread Manuel Krebber via swift-evolution
Am 27.06.2016 20:55, schrieb Christopher Kornher: On Jun 27, 2016, at 2:45 AM, Manuel Krebber via swift-evolution wrote: On 06/26/2016 09:10 PM, Christopher Kornher via swift-evolution wrote: The core proposal: —— Closures capturing object references should

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Charlie Monroe via swift-evolution
> On Jun 27, 2016, at 9:10 PM, Christopher Kornher wrote: > > >> On Jun 26, 2016, at 11:22 PM, Charlie Monroe via swift-evolution >> > wrote: >> >>> All object references used within a closure must unwrap

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Christopher Kornher via swift-evolution
> On Jun 27, 2016, at 2:35 PM, L. Mihalkovic via swift-evolution > wrote: > > > > Regards > (From mobile) > > On Jun 27, 2016, at 10:18 PM, Dennis Lysenko via swift-evolution > > wrote: > >> My 2c: >>

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Christopher Kornher via swift-evolution
> On Jun 27, 2016, at 2:35 PM, L. Mihalkovic via swift-evolution > wrote: > > > > Regards > (From mobile) > > On Jun 27, 2016, at 10:18 PM, Dennis Lysenko via swift-evolution > > wrote: > >> My 2c: >>

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Christopher Kornher via swift-evolution
> On Jun 27, 2016, at 2:51 PM, Russ Bishop via swift-evolution > wrote: > >> >> On Jun 27, 2016, at 12:35 AM, Christopher Kornher > > wrote: >> >> >>> On Jun 26, 2016, at 4:25 PM, Russ Bishop >>

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread L. Mihalkovic via swift-evolution
Regards (From mobile) > On Jun 27, 2016, at 10:18 PM, Dennis Lysenko via swift-evolution > wrote: > > My 2c: > > This proposal is made more appealing to me because it is not simply a > 'beginners will get confused' issue. > > I have written tens of thousands of

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Dennis Lysenko via swift-evolution
My 2c: This proposal is made more appealing to me because it is not simply a 'beginners will get confused' issue. I have written tens of thousands of lines of Swift from Swift 1 to the Swift 3 preview and I still can't shake occasionally accidentally capturing `self` strongly when I, for

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Christopher Kornher via swift-evolution
> On Jun 26, 2016, at 11:22 PM, Charlie Monroe via swift-evolution > wrote: > >> All object references used within a closure must unwrap successfully for the >> closure to execute. > I agree with the logic of this proposal, but this is the confusing part or a >

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Christopher Kornher via swift-evolution
> On Jun 27, 2016, at 2:45 AM, Manuel Krebber via swift-evolution > wrote: > > On 06/26/2016 09:10 PM, Christopher Kornher via swift-evolution wrote: >> The core proposal: >> —— >> >> Closures capturing object references should automatically capture all >>

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Manuel Krebber via swift-evolution
On 06/26/2016 09:10 PM, Christopher Kornher via swift-evolution wrote: > The core proposal: > —— > > Closures capturing object references should automatically capture all > object references as weak. In my code, most closures are used in a functional programming capacity, e.g. with map(),

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-27 Thread Christopher Kornher via swift-evolution
> On Jun 26, 2016, at 4:25 PM, Russ Bishop wrote: > > >> On Jun 26, 2016, at 12:10 PM, Christopher Kornher via swift-evolution >> wrote: >> >> I may be too late for Swift 3, but I am planning to propose changes to the >> default behavior for

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-26 Thread Charlie Monroe via swift-evolution
> All object references used within a closure must unwrap successfully for the > closure to execute. I agree with the logic of this proposal, but this is the confusing part or a part that I slightly disagree with. By this logic, the block won't be invoked if all captured variables can't be

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-26 Thread Russ Bishop via swift-evolution
> On Jun 26, 2016, at 12:10 PM, Christopher Kornher via swift-evolution > wrote: > > I may be too late for Swift 3, but I am planning to propose changes to the > default behavior for closures capturing object references. The introduction > of Swift Playgrounds has

[swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-26 Thread James Froggatt via swift-evolution
Agreed. Strong capture without an explicit variable binding is unintuitive and generally unsafe. I think it is worth aiming for Swift 3, considering the potential impact. I have to admit I am quite a heavy user of unowned. If a change somewhere invalidates my assumptions, I'd rather know about

Re: [swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-26 Thread Charles Srstka via swift-evolution
I like it. Accidental capture of a variable is probably one of the primary causes of retain cycles in modern Swift code. Requiring the capture to be explicit would take a lot of the surprise out of it and force the developer to think about the capture semantics. +1. Charles > On Jun 26,

[swift-evolution] An upcoming proposal for simplifying leak free, safe closures.

2016-06-26 Thread Christopher Kornher via swift-evolution
I may be too late for Swift 3, but I am planning to propose changes to the default behavior for closures capturing object references. The introduction of Swift Playgrounds has raised the importance of simplifying the coding of leak-free, crash-free closures. New developers should not have to