<div dir="ltr">I get that :) but I think it would be helpful to go beyond the no-op case and help solve the &quot;strongify&quot; situation that exists in the larger problem domain.<div><br></div><div>The &quot;strongify&quot; issue – to me – is mostly about avoiding the need to rename the captured var in the block to allow for the reference to become a strong reference. I feel it would be great to tackle that for more then the no-op case.</div><div><br></div><div>In my experience I have had what once was &quot;a simple no-op on nil case&quot; turn into &quot;if nil do some book keeping and no-op the rest&quot; often enough to desire a broader solution.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 19, 2016 at 2:03 PM Kurt Werle &lt;<a href="mailto:kurt@circlew.org">kurt@circlew.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 19, 2016 at 1:39 PM, Shawn Erickson via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>For example [guard self] capture option supports one specific situation without the ability of the block to take alternate actions in the situation of weak self being nil and also requiring no return blocks. This is great obviously for that particular situation however it doesn&#39;t really help with the other situations.</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>That&#39;s the beauty of it.  If you want to do something else, this isn&#39;t what you want.  This is just a simple bit of sugar to get rid of the very common use case where you have a nilable/void callback that you only want executed if self is not nil.</div><div><br></div><div>If you want/need to do something more complicated, then</div><div>{ [unowned self] in</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>  guard self != nil else {</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>    Do the other thing</div><div>  }</div><div>}</div></div><div>is great.  It&#39;s not boilerplate because you&#39;re doing something useful in the else case.</div><div><br></div><div>I do still prefer the [unowned self]? syntax, though.  It feels so similar to object?.doSomething().  If the lvalue is nil, you get nothing!</div></div></div><div dir="ltr"><div class="gmail_extra"><div><br></div><div>Kurt</div>-- <br><div>kurt@CircleW.org<br><a href="http://www.CircleW.org/kurt/" target="_blank">http://www.CircleW.org/kurt/</a><br></div>
</div></div></blockquote></div>