# Guarded closures

**URL:** <https://forums.swift.org/t/guarded-closures/11029>\
**Category:** Discussion\
**Created:** [March 16, 2018, 4:24am UTC](https://forums.swift.org/t/guarded-closures/11029 "2018-03-16T04:24:42Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![acecilia](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/acecilia/32/11213_2.png) [@acecilia](https://forums.swift.org/u/acecilia)\
**Post date:** [June 10, 2018, 4:07pm UTC](https://forums.swift.org/t/guarded-closures/11029/18 "2018-06-10T16:07:10Z")

</div>

> [@xwu](#):
>
> In any case, it can be interesting to visit old topics when something new changes the context. To drive the conversation forward, do you have concrete use cases that haven't been previously considered?

No. I am bringing back the discussion because:  
a) It is being mentioned lately during the discussion of the "Allowing shadowing and rebinding of self" proposal (with people for and against it), and I see it keeps getting support [here](https://gist.github.com/emaloney/d34ac9b134ece7c60440).  
b) I could not find a rationale with purely technical reasons agains it (most of the reasons agains it that I have red are very subjective to the developer talking).  
c) Considering that I could not find purely technical reasons agains it, I looked for a subjective reason against it coming from the core team. I could not find it either.  
d) I saw the recently approved `toggle()` proposal, and I think the rationale for accepting it has several similarities with the rationale I would give to this `[guard self]` proposal.  
e) Due to point d), and considering that this discussion has happened already several times without a clear acceptance/rejection outcome, I think it would be interesting to push a bit more for it, or even make an official proposal in order to get more visibility, and eventually an acceptance/rejection rationale, making things clear and preventing the discussion from happening in the future.

This discussion being repeated over an over is an indicator to me that several developers are seeking for an alternative for `[weak self] in guard let strongSelf = self else { return }`. Having a clear rationale for or againt it would help.

As an example, the ["Allowing shadowing and rebinding of self"](https://forums.swift.org/t/the-future-of-weak-self-rebinding/10846) proposal has been [accepted](https://github.com/apple/swift-evolution/blob/master/proposals/0079-upgrade-self-from-weak-to-strong.md) in September 2016, but an [implementation](https://github.com/apple/swift/pull/15306) of it did not happen until March 2018, even though the context did not change from 2016 to 2018. And I believe that the reason for this is that in 2016, the focus of the community was on other more important topics, but now in 2018 the focus is shifting thowards this not so important - but still possible to improve - syntactic issues that we are seeing lately.

---

_[View the full topic](https://forums.swift.org/t/guarded-closures/11029)._
