<div dir="ltr"><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large"><span style="font-family:arial,sans-serif;font-size:small">On Tue, Aug 25, 2015 at 12:01 PM, Florian Festi </span><span dir="ltr" style="font-family:arial,sans-serif;font-size:small"><<a href="mailto:ffesti@redhat.com" target="_blank">ffesti@redhat.com</a>></span><span style="font-family:arial,sans-serif;font-size:small"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 08/25/2015 05:54 PM, Pavel Odvody wrote:<br>
>> Technically a NOT operator should not be needed. So we are basically<br>
>> looking for real life examples where it would be really handy or even a<br>
>> pain if it was missing. What would you do with a NOT operator?<br>
>><br>
><br>
> Requires: (PkgA AND (PkgB IF NOT PkgC)<br>
<br>
> But I'm really not sure whether it isn't just easier (correct) to handle<br>
> this through conflicts / virtual provide.<br>
<br>
</span>Well, as Requires are (logically) all connected with an AND this is<br>
equivalent to:<br>
<br>
Requires: PkgA<br>
Requires: (PkgB IF NOT PkgC)<br>
<br>
And as IF is equivalent to OR NOT this is equivalent to<br>
<br>
Requires: PkgA<br>
Requires: (PkgB OR PkgC)<br>
<br>
That's why I am interested in *real world* examples where we can at<br>
least argue that writing it in a given way is more clear and the one<br>
without using NOT.<br>
<span class="im"><br>
>> [2] We are talking about Boolean operators here - not if statements.<br>
>> Those variants are identical to the forward and backward implication<br>
>> which are identical to (NOT . OR .) and (. OR NOT .)<br>
<br>
<br>
</span><span class=""><font color="#888888">Florian<br>
</font></span><div class=""><div class="h5"><br>
--<br>
<br>
Red Hat GmbH, <a href="http://www.de.redhat.com/" rel="noreferrer" target="_blank">http://www.de.redhat.com/</a> Registered seat: Grasbrunn,<br>
Commercial register: Amtsgericht Muenchen, HRB 153243,<br>
Managing Directors: Charles Cachera, Michael Cunningham, Michael<br>
O'Neill, Charles Peters<br></div></div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">​​From my point of view, I prefer the expressive syntax (IF, ELSE, THEN, OR, AND, NOT)​, though I'm not sure if making it case sensitive really helps anything. Because they have to be grouped in parenthesis anyway, I don't think the enforced all-caps is really necessary. That said, as a C/C++, Java, and now Python programmer, I feel quite at home with boolean logic symbols ( "||", "&&", "!") . I really don't think it would hurt anything if we supported both kinds.</div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large"><br></div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">I consider the NOT evaluation to be useful for intent more than anything else.</div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large"><br></div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">For example: "Requires: (pkgA IF NOT pkgB)" or "Requires: (IF NOT pkgB THEN pkgA)"</div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">That lines says two things to me:</div><div class="gmail_default" style=""><ul style=""><li style=""><font face="times new roman, serif" size="4">The package prefers pkgB over pkgA</font></li><li style=""><font face="times new roman, serif" size="4">Either option works (functionally an OR operation)</font></li></ul><div><font face="times new roman, serif" size="4">This could be handy for declaring priority of dependencies based on what functionality it provides. </font></div><div><font face="times new roman, serif" size="4"><br></font></div><div><font face="times new roman, serif" size="4">For a more concrete example, suppose I have a package that has a runtime dependency on a kmod package. However, the kmod package is available in several forms (akmod, dkms, and finally kmod). I could set up something like this:</font></div><div><font face="times new roman, serif" size="4"><br></font></div><div><font face="times new roman, serif" size="4">"Requires: (IF NOT (IF NOT module-kmod THEN module-akmod) THEN module-dkms)" </font></div><div><font face="times new roman, serif" size="4"><br></font></div></div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">​If read with the intent given, then that means that if module-kmod isn't installable, then use module-akmod. If that's not installable, then use module-dkms. </div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large"><br></div><div class="gmail_default" style="font-family:'times new roman',serif;font-size:large">Or maybe I'm misreading how this would work, but that's how I interpret it.</div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">真実はいつも一つ!/ Always, there's only one truth!<br></div></div>
</div><font face="yw-402608bc37fe50adb11a5899295781aeb83d248d-1684df51938ee61c1a76b9caa8d922b5--o" style="display: none;"></font></div>