As for me, it is too confusing.<br><br><div class="gmail_quote">On Sun, Jul 25, 2010 at 12:15 AM, Sebastian Trüg <span dir="ltr">&lt;<a href="mailto:trueg@kde.org">trueg@kde.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi guys,<br>
<br>
at the Akademy a very good idea came up: using C++ operator overloads to<br>
construct queries. This is very straight-forward for AndTerm and OrTerm:<br>
<br>
   term1 &amp;&amp; term2 &amp;&amp; term3<br>
<br>
   term1 || term2 || term3<br>
<br>
But it gets nicer (thanks to Vishesh for the tip):<br>
<br>
   Vocabulary::NIE::contentCreated() &gt; Query::LiteralTerm( dateTime1 );<br>
   Vocabulary::NAO::hasTag() == term;<br>
<br>
which results in the following ComparisonTerms:<br>
<br>
   ComparisonTerm(<br>
        Vocabulary::NIE::contentCreated(),<br>
        Query::LiteralTerm( dateTime1 ),<br>
        ComparisonTerm::Greater );<br>
<br>
   ComparisonTerm(<br>
        Vocabulary::NAO::hasTag(),<br>
        term,<br>
        ComparisonTerm::Equal );<br>
<br>
So far so good. But now let me give you the idea which I would like some<br>
feedback on. By interchanging the two parameters of the operator we<br>
create an inverted ComparisonTerm:<br>
<br>
   term == Vocabulary::NAO::hasTag();<br>
<br>
will create the following term:<br>
<br>
   ComparisonTerm(<br>
        Vocabulary::NAO::hasTag(),<br>
        term,<br>
        ComparisonTerm::Equal ).inverted();<br>
<br>
For me this is very convenient. But it might be rather confusing. But<br>
then again inverted terms are confusing to begin with.<br>
<br>
So any opinions?<br>
<br>
Cheers,<br>
Sebastian<br>
_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Sincerely yours,<br>Artem<br>