<div dir="ltr">No strong objection, although I like "guard" because it implies that the first statement in the closure is an implicit guard on the value captured.<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 12:08 PM, Jason Gregori <span dir="ltr"><<a href="mailto:jasongregori@gmail.com" target="_blank">jasongregori@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div></div><div>What about dropping "guard"? [reconstitute self] (I'll look in the thesaurus later today). </div><div><div class="h5"><div><br>On Feb 12, 2016, at 11:57 AM, Jonathan Tang <<a href="mailto:jonathan.d.tang@gmail.com" target="_blank">jonathan.d.tang@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">+1 to the proposal as it stands, including dropping the "else" or extending to non-void closures. If they turn out to be a problem, another proposal could be written for them at a later date.<div><br></div><div>I don't really like the idea of adding another word in there, either [guard weak self] or [guard reconstitute self]. To me, [guard self] is another capture semantics, just like [weak self] and [unowned self], and I find it easier to remember if I can mentally put it in the set of capture semantics than if I mentally hang it off of [weak self] as a special case. I don't think there's any reasonable phrase that will explain exactly what this does without people having to spend a few minutes reading the manual and absorbing the information, so I'd rather optimize for conciseness for those who've done this rather than clarity for those who haven't.<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 11:08 AM, Jason Gregori via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Feb 12, 2016 at 10:34 AM, Erica Sadun <span dir="ltr"><<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>How about </div><div><br></div><div><font face="Menlo">guard reconstitute self else { return }</font></div></div></blockquote><div><br></div></span><div>I like the idea behind this but I feel like a line inside the block can't really dictate whether self is captured weakly or not. Unless your saying put this in the bracket part?</div><div><br></div><div>[guard reconstitute self] ? That works for me.</div><div><br></div><div><br></div><div>PS: I got here from your blog post, thanks!</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><font face="Palatino-Roman">-- E</font></div><br><div><blockquote type="cite"><div><div><div>On Feb 12, 2016, at 11:28 AM, Jason Gregori via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br></div></div><div><div><div><div dir="ltr"><span style="font-size:13px">I like Kenny and Kurt's points about handling the majority case and keeping the syntax simpler.</span><br style="font-size:13px"><div style="font-size:13px"><br></div><div style="font-size:13px">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?<br></div><div style="font-size:13px"><br></div><div style="font-size:13px">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.</div><div style="font-size:13px"><br></div><div style="font-size:13px">So:</div><div style="font-size:13px"><br></div><div style="font-size:13px">[guard weak self, other]</div></div></div></div>
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></blockquote></span></div><br></div></div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div></div>
</div></blockquote></div></div></div></blockquote></div><br></div></div>