When reading the thread about low-level arrays in TeX I stumbled over a note in Bruno Le Floch's answer:
A long string of characters is stored more efficiently as a csname than as a list of tokens. This has been used at some point in
l3fp, storing 10000 decimals of1/(2pi)as\159154943091895..., to be passed to\stringwhen needed.
I can't find that definition in the l3fp files and I'm curious how it works. The problem seems to boil down to the question "How do you refer to a control sequence name without knowing the full name?" For example, if you assign a shorter name \expandafter\let\expandafter\short\csname very long name\endcsname, you can't refer to the original name with \short later because only the meaning is assigned to \short. On the other hand, a construction that involves \def or similar pretty much defeats the purpose because then you need to store the characters as tokens again.
What is the (plain TeX/e-TeX) pattern used here that makes this efficient string storing work?
l3fp, but now the same is achieved with\intarraywhich is even more efficient (it uses\fontdimen). – egreg Sep 04 '18 at 22:20l3fp-trig.dtxwhere this is done (with a new method, as egreg said): "The memory footprint (1/2 byte per digit) is the same as an earlier method of storing the data as a control sequence name, but the major advantage is that we can unpack specific subsets of the digits without unpacking the 10112 decimals." – Phelype Oleinik Sep 04 '18 at 22:29\edef\zzz{\expandafter\noexpand\csname 1234567890\endcsname}is equivalent (if you set catcodes up) to\def\zzz{\1234567890}and stores the 10 digit number as a single csname, which you can get back the digits via\meaning\zzz– David Carlisle Sep 05 '18 at 00:20