Quantcast
Channel: Active questions tagged mapping - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 50

Can you map arbitrary token sequences expandably and unambiguously to numbers or to strings of explicit character tokens of category 12?

$
0
0

How to map arbitrary brace-balanced sequences of non-outer tokens expandably and unambiguously to numbers or to strings consisting exclusively of explicit character tokens of category 12, if possible only with macros/things that can be implemented in Knuthian-TeX?

At first I thought of stringifying all tokens in a loop and then calculating some sort of unambiguous checksum, but stringifying involves losing information about categories and therefore such an approach cannot distinguish all possible token sequences.

I would be grateful for an outline of how to approach the matter. I can then think about the details of a concrete implementation myself.

However, I have my doubts:

If this could be done in a way which is reliable to one hundred percent, then this could be used as an expandable method to distinguish, for example,

  • an active character-token let equal to a non-active pendant from that pendant.
  • frozen-\relax from the \relax-primitive.
  • the nameless control-sequence (producible via \csname\endcsname or via an escape-character (backslash) at the end of a line of .tex-input while \endlinechar has a negative value) from the control-sequence whose name is csname⟨escapechar⟩endcsname (producible via \csname csname\string\endcsname\endcsname) while those control-sequences have the same non-outer meaning.
  • explicit (non-outer) character token from one-letter-control-sequence let equal to that explicit character token when the character-code corresponds to the character which forms the name of the control-sequence while \escapechar has a negative value.
  • frozen font control sequences obtained by applying \the to a font command from the original font command.
  • ...

Can I conclude that an expandable approach restricted to means provided by Knuthian-TeX is rather not possible in a way that is one hundred percent reliable and practical?

How to approach the matter if expandability/sticking to Knuthian-TeX is not an issue?


Viewing all articles
Browse latest Browse all 50

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>