I had trouble parsing, too, for some reason. In fact, that is what his
amended proposal states - the else part is to be dropped.
I like this proposal, though I do wonder if it would be nice to have the
So we could also adapt
func requiresNonNilParameters(some: MyClass!)? -> Whatever
that returns if all the parameters are != nil.
Still, I'd be happy if [guard self] did what is proposed.
On Fri, Feb 12, 2016 at 10:28 AM, Jason Gregori via swift-evolution < email@example.com> wrote:
I like Kenny and Kurt's points about handling the majority case and
keeping the syntax simpler.
I feel like most of the time I want to break a retain cycle is for a
completion block which returns void. Can we just handle that case and get
rid of the else?
Also, I don't think [guard self] is self explanatory enough. I think weak
should be in there so it's much more obvious you are doing the weak/strong
dance with self, otherwise it looks like you are guarding against a regular
optional being nil.
[guard weak self, other]
swift-evolution mailing list