[texhax] Any crazy math formulas for testing a TeX language interpreter
David Carlisle
d.p.carlisle at gmail.com
Wed Jan 13 20:56:10 CET 2016
On 13 January 2016 at 19:04, Douglas McKenna <doug at mathemaesthetics.com>
wrote:
> Joseph Wright wrote -
>
> > In any case, some form of expandable comparison that ignores catcodes is
> > very useful, and it's essential to use expl3 (we found some years ago
> > that this was the one post-e-TeX primitive that was vital in all cases,
> > though as David notes once you get to dealing with Unicode then some
> > ability to generate tokens across the full range is also needed).
>
>
> So … something like a three-way switch, e.g.,
>
> \ifstrcmp <char token list> <char token list>
> <case 0 for less than> \or
> <case 1 for equal> \or
> <case 2 for greater than>
> \fi
>
> ?
>
> Or a two-way explicit comparison of some kind, e.g.,
>
> \ifstrcmp { <char token list> } < = > { <char token list> }
> TRUE
> \else
> FALSE
> \fi
>
> ?
>
see
pdftex manual (page 37) which says:
\pdfstrcmp {general text} { general text }(expandable)
This command compares two strings and expands to 0 if the strings are
equal, to -1 if the first string
ranks before the second, and to 1 otherwise. The primitive was introduced
in pdfTEX 1.30.0.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20160113/4743a7d0/attachment.html>
More information about the texhax
mailing list