[Tex/LaTex] \pdfstrcmp or \strcmp in pure TeX

latex3pdfstrcmptex-core

I'm trying to get LaTeX3 working with an old e-TeX kernel, and it fails due to the lack of \pdfstrcmp (or XeTeX's \strcmp equivalent).

Is there a pure TeX definition of \pdfstrcmp that I could insert into the top of my file? or is this not possible?

Best Answer

The short answer is 'no'. The longer version is that this primitive (almost certainly) cannot be implemented in macros: primitives rarely can be. In particular, \pdfstrcmp can do an expandable comparison of two sets of tokens on a character ('string') basis, without loosing any spaces. In the past, the LaTeX3 team did have some code which attempted to do the same thing using only (e-)TeX primitives, but there were limitations and we ended up with issues as a result. The availability of this primitive is very useful for a number of functions which otherwise cannot be implemented expandably, and the team therefore made a decision to require it in addition to those from e-TeX: it's been available for a number of years.

Related Question