Closed krono closed 2 years ago
I find myself writing a lot of code like:
\ifbool{foo}{}{\knorx} \notbool{barf}{\zork}{}
with one of the branches empty.
What about one-armed versions?
\newcommand*{\whenbool}[1]{% \ifcsundef{if#1} {\etb@err@nobool{#1}\@gobble} {\csname if#1\endcsname \expandafter\@firstofone \else \expandafter\@gobble \fi}} \newcommand*{\whennotbool}[1]{% \ifcsundef{if#1} {\etb@err@nobool{#1}\@gobble} {\csname if#1\endcsname \expandafter\@gobble \else \expandafter\@firstofone \fi}}
Note: i chose whennotbool, because unlessbool was already taken.
whennotbool
unlessbool
I understand the thinking (it's what expl3 does), but within the classical 2e framework all conditionals have two branches.
expl3
OK :)
I find myself writing a lot of code like:
with one of the branches empty.
What about one-armed versions?
Note: i chose
whennotbool
, becauseunlessbool
was already taken.