1 \documentclass{article}
11 \AUTHOR{David Carlisle}
13 \declare@command\ifthenelse
14 \declare@command\whiledo
20 \message{^^J\expandafter\xx\meaning\@tempa}%
21 \message{^^J\@spaces#1: }%
22 \setbox6=\hbox{\ifthenelse{#2}{\gdef\zzz{yes}}{\gdef\zzz{no }}}%
23 \message{\zzz\ifx\zzz\yyy\else!! (wrong value)\fi}%
24 \ifdim\wd6>\z@\message{!! (non zero width)}\fi}
27 \test{yes}{1=1 \and 2=2}
29 \test{no }{1=1 \and 1=2}
31 \test{yes}{1=3 \or 2=2}
33 \test{yes}{\(1=3 \and 2=2\) \or 5=5}
35 \test{no }{\(1=3 \and 2=2\) \and 5=5}
37 \test{yes}{\(1=3 \and 2=2\) \or \( 5=5 \or 1=7\)}
39 \test{yes}{ \( 5=5 \)}
41 \test{no }{ \( 5=9 \)}
47 \test{yes}{\not\not 1=1}
49 \test{no }{\not\not 1=2}
51 \typeout{******************}
57 \test{no }{\boolean{aaa}}
61 \test{yes}{\boolean{aaa}}
63 \test{yes}{\boolean{aaa} \and 1 < 3 }
65 \def\aaa{\AAA}\def\AAA{aaa}
70 \( \equal{aaax}{\aaa} \or 1=1 \)
75 \( \equal{aa}{bb} \or \equal{\aaa}{aaa} \)
82 \test{yes}{\boolean{true}}
85 1<2 \and \( 1=1 \and 2 < 3 \) \and \( \equal{aa}{aa} \or 1<4 \)}
88 1<2 \and \( 1=1 \and 2 < 2 \) \and \( \equal{aa}{aa} \or 1<4 \)}
91 1<2 \and \( 1=1 \and 2 < 2 \) \and \not \( \equal{aa}{aa} \or 1<4 \)}
140 % as `11xx' is not a number, this should be false, but the
141 % current implememtation makes the `true'.
145 % The current implementation can not deal with primitive
146 % TeX count registers, only literal digit strings and LaTeX counters
159 \isodd{\pageref{foo}}}
166 \isodd{\pageref{bar}}}
170 \lengthtest{ 1pt < 1in} }
174 \lengthtest{ 1pt = 1in} \or \( \boolean{false} \and 3 = 3 \) }
178 \lengthtest{ 1pt = 1in} \or \( \boolean{false} \and 3 = 3 \)
179 \or \lengthtest{72bp = 1in} }
183 \lengthtest{72bp = 1in} }
190 \setboolean{abc}{TRUE}
196 \boolean{true} \or \isodd{\pageref{bar}}}
198 \def\aaa{\iftrue b\fi}
201 \test{yes}{\equal{\aaa}{\bbb}}
203 \def\aaa{\iffalse a\else b\fi}
206 \test{yes}{\equal{\aaa}{\bbb}}
208 \test{yes}{\boolean{true} \or \isodd{3}}
210 \test{yes}{\boolean{true} \or \equal{x}{y}}
216 \whiledo{ \value{A} > 0}{\typeout{\theA}\addtocounter{A}{-1}}