On 20 Feb 2017, at 06:05, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org> wrote:
>> On Feb 19, 2017, at 7:06 PM, Matthew Johnson <matt...@anandabits.com> wrote: >> >> Often you hand it to something owned by self, but it's also the case that >> you often hand it to something not owned by self, but that should not extend >> the lifetime of self. > > I don't agree that it shouldn't extend the lifetime of `self`. By default, > Swift assumes that if you capture an object in a closure, you want that > object to stay alive as long as the closure does. > > I see absolutely no reason that this assumption should be different for > `self` than it is for any other variable, and I see no reason to believe the > caller would have a particularly good idea about this. Totally agree. The proposal would complicate reasoning about reference cycles and lifetime of objects by creating special cases which depend on what variable is concerned (self or other) and what the API does. > -- > Brent Royal-Gordon > Architechies > > _______________________________________________ > swift-evolution mailing list > swift-evolution@swift.org > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution