<p>Here are some points to discuss:</p>
<ol>
<li>
<p>The ternary op currently uses the same logic as rpmExprBool to evaluate if the condition is true or not. But the other logical operators (!, &&, ||) only work with integers. We should make this consistent, either by changing ternary to only accept integers or by changing the other ops to also accept strings.</p>
</li>
<li>
<p>There probably should be a test that makes sure the true and false part of a ternary op have the same type. I.e. the <code>%test ? 2 : "foo"</code> should not be allowed.</p>
</li>
<li>
<p>Does it make sense to have variants with missing parts?</p>
</li>
</ol>
<pre><code>
%foo ? %bar         Use alternate value
                    Return %bar if %foo is true, otherwise 0 or ""
                    (probably not so interesting, it's easy to write `: 0` or `: ""`)
%foo ?: %bar        Use default value
                    Return %foo if %foo is true, otherwise %bar
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/852?email_source=notifications&email_token=ADLPZU7POBYHNUHRKRHRT33QLCXBLA5CNFSM4IZKAJL2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HNAQ4AQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZU5SCH6BHHLOPKKURZDQLCXBLANCNFSM4IZKAJLQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ADLPZU6N3OFHW2AUW2NKKRTQLCXBLA5CNFSM4IZKAJL2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HNAQ4AQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/issues/852?email_source=notifications\u0026email_token=ADLPZU7POBYHNUHRKRHRT33QLCXBLA5CNFSM4IZKAJL2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HNAQ4AQ",
"url": "https://github.com/rpm-software-management/rpm/issues/852?email_source=notifications\u0026email_token=ADLPZU7POBYHNUHRKRHRT33QLCXBLA5CNFSM4IZKAJL2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HNAQ4AQ",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>