The answer has been given by Werner. xintexpr knows about etoolbox booleans and toggles. Different syntaxes allow different levels of laziness:
[sorry I got wrong the way "lazy" was to be interpreted; thus I switch to "silly"]
- silly: booleans are replaced by 1 or 0 depending on whether they evaluate to true or false, and then the logical
or
does not stop scanning these 1
's or 0
's even if it has found already a true one.
- semi-silly: the booleans are evaluated but the
or
stops when it has found a true one
- not silly: booleans are not evaluated unless really needed.
In the code snippet below, the three different syntaxes realize the three possibilities described above:
\documentclass{article}
\usepackage{etoolbox}
\usepackage{xintexpr}
\begin{document}
\newbool{testA}
\newbool{testB}
\newbool{testC}
\booltrue{testA}
\booltrue{testB}
\booltrue{testC}
%\tracingmacros1
% silly
\xintifboolexpr{ bool(testA) | bool(testB) | bool(testC) }{OK}{Something's wrong...}
% semi-silly
\xintifboolexpr{ any(bool(testA),bool(testB),bool(testC)) }{OK}{Something's wrong...}
% not silly
\xintifboolexpr{ bool(testA)?1{bool(testB)?1{bool(testC)}} }{OK}{Something's wrong...}
\end{document}