2017-04-16 10:08 GMT+02:00 Julian Bradfield <jcb+xe...@jcbradfield.org>:

> On 2017-04-15, Bruno Le Floch <blfla...@gmail.com> wrote:
> > The primitive conditional "\ifcat\relax\cr true\else false\fi" gives
> > "true" in pdfTeX, LuaTeX, (e)(u)pTeX, and XeTeX from some time ago
> > (could be years), but "false" in XeTeX 0.99996
>
> Definitely a bug. The TeXbook defines the behaviour of \if and \ifcat,
> and all control sequences are considered to have character code 256
> and category code 16, unless \let equal to a non-active character, in
> which case they have the value of that character.
>
> Not all control sequences but primitives. Unlike \ifx, \if and \ifcat
perform full expansion.
Try the following code:

\def\a{$A$}
\def\b{hello}
\def\c{world}
\ifcat\a\b\else\c\fi

The output will be world because $ and A have different category codes.

Similarly, \ifcat\relax\a will compare \relax with $.


Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz



>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>

--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to