<div dir="ltr"><div class="markdown-here-wrapper" style=""><pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-swift" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">infix</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">operator</span> ♠️ : <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">LogicalDisjunctionPrecedence</span>
<span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">infix</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">operator</span> ♥ : <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">LogicalDisjunctionPrecedence</span>
<span class="hljs-func"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">func</span> ♠️<span class="hljs-generics"><T></span><span class="hljs-params">(lhs: Bool, rhs: @autoclosure <span class="hljs-params">()</span> throws -> T)</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">rethrows</span> -> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">T</span>? </span>{
<span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">if</span> lhs { <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">return</span> rhs() } <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">else</span> { <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">return</span> <span class="hljs-built_in" style="color:rgb(0,134,179)">nil</span> }
}
<span class="hljs-func"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">func</span> ♥<span class="hljs-generics"><T></span><span class="hljs-params">(lhs: T?, rhs: @autoclosure <span class="hljs-params">()</span> throws -> T)</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">rethrows</span> -> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">T</span> </span>{
<span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">return</span> lhs ?? rhs
}
<span class="hljs-comment" style="color:rgb(153,153,136);font-style:italic">// Equivalent statements:</span>
condition() ? first() : second()
condition() ♠️ first() ♥ second()
</code></pre>
<p style="margin:0px 0px 1.2em!important">By removal of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">?:</code>, we could simplify our system of operators and prevent some ternary-related bugs/unexpected stuff. We could modify reserved operators to allow <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">?</code> instead of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">♠️</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">:</code> instead of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">♥</code>.</p>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPmBgYHN3aWZ0PGJyPjwvZG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