<div dir="ltr"><div dir="ltr">On Thu, Apr 11, 2024 at 1:17 PM Laurence Penney <<a href="mailto:lorp@lorp.org">lorp@lorp.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Personally I like this a lot. Each node on the condition tree can be very cheaply cached once evaluated, too.<br>
<br>
I like the idea of if..else on top of this, since, as Skef noted elsewhere, it is a common case to include one component on true, and a different component on false. Or is it sufficient that, for the else branch, we use a negate condition and point to the (cached result of the) just-evaluated node?<br></blockquote><div><br></div><div>The latter sounds better to me. Otherwise just representing this in APIs will become more cumbersome. I'm also fine burning a bit of VarComponent flags to negate the result (on top of this proposal).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- L<br>
<br>
> On 11 Apr 2024, at 16:44, Behdad Esfahbod via mpeg-otspec <<a href="mailto:mpeg-otspec@lists.aau.at" target="_blank">mpeg-otspec@lists.aau.at</a>> wrote:<br>
> <br>
> Thanks Skef.<br>
> <br>
> I think I found the right approach for this (taking ideas from COLRv1 paint tree / graph). Ignoring your other proposals, we add these:<br>
> <br>
> We add new Condition's that implement AND of a bunch of Conditions (like the current ConditionSet does), another for OR, and another for NEGATE:<br>
> <br>
> struct ConditionAnd<br>
> {<br>
> uint16 format; // 2<br>
> uint16 conditionCount; // Number of conditions for this conjunction expression.<br>
> Offset32To<Condition> conditionOffsets[conditionCount];<br>
> }<br>
> <br>
> struct ConditionOr<br>
> {<br>
> uint16 format; // 3<br>
> uint16 conditionCount; // Number of conditions for this disjunction expression.<br>
> Offset32To<Condition> conditionOffsets[conditionCount];<br>
> }<br>
> <br>
> struct ConditionNegate<br>
> {<br>
> uint16 format; // 4<br>
> Offset32To<Condition> condition;<br>
> }<br>
> <br>
> WDYT?behdad<br>
> <a href="http://behdad.org/" rel="noreferrer" target="_blank">http://behdad.org/</a><br>
> <br>
> <br>
<br>
</blockquote></div></div>