Choice of processor

Philip Taylor P.Taylor at Hellenic-Institute.Uk
Wed Mar 5 12:48:27 CET 2025


On 05/03/2025 11:24, David Carlisle wrote:
> LaTeX has been providing a strcmp implementation in Lua for decades so 
> for the vast majority of users such issues (the point of the thread 
> started by Peter) simply don't exist. If you choose to use plain tex 
> and ignore decades of development by other people that's fine but you 
> then need to actually do the work of doing those implementations,

Except that in my /preferred/ processor (XeTeX), I do not /need/ LaTeX 
in order to perform a simple string comparison (as indeed I don't /need 
/LaTeX in order to do anything, nor have I ever done) — XeTeX provides 
me (and others) with a simple functional primitive.  If LuaTeX does not, 
then perhaps LuaTeX should be enhanced so to do.


> but to give you a start latex uses
>
> [code stripped]
>
> You might want to call it \strcmp rather than \tex_strcmp:D but 
> otherwise it should work put it inside \directlua{...}

Thank you — that is most helpful.  Sadly it did not work out of the box, 
until I realised that the "\begin{macro}[no-user-doc]{\tex_strcmp:D}" 
did not belong inside \directlua {} but was in fact pure LaTeX code.  
Replacing that part with

\def \strcmp
     {%
         \directlua
             {%
                 %   Compare two strings, expanding to |0| if they are 
equal,
                 % [...]

             }%
     }

does indeed appear to allow me to compare strings /à la/ XeTeX.  Many 
thanks !

> I removed tex-live list, it's unrelated to tex-live and I'm sure Karl 
> has other things to do with TL2025 release

Well, the thread /started/ on the TeX-Live list, so it seemed only 
courteous and proper to keep it in the CC list.  Peter FLynn cc'd, as I 
do not know whether he subscribes to TeXhax.

-- 
/** Phil./

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20250305/aa6381b1/attachment.htm>


More information about the texhax mailing list.