<div dir="ltr">Hi all,<div><br></div><div>Curious to hear thoughts on allowing non-binding pattern matches to be used as boolean values outside of an if, guard, for...in, while, switch, etc. Something like:</div><div><br></div><div>enum List&lt;T&gt; {</div><div>     case Empty</div><div>     indirect case Link(T, List&lt;T&gt;)</div><div>     </div><div>     func isEmpty() -&gt; Bool {</div><div>          return case .Empty = self</div><div>     }</div><div>}</div><div><br></div><div>It gets rid of some boilerplate (explicit return true and return false), and seems intuitive that it would work given that you can already do </div><div><br></div><div>if case .Empty = self {</div><div>     return true</div><div>} else {</div><div>     return false</div><div>}</div><div><br></div><div>I haven&#39;t really thought through all the implications here, so there&#39;s probably something I&#39;m missing. It also may be useful only in such limited situations that it&#39;s not worth the trouble to add.</div><div><br></div><div>-Alex</div></div>