[luatex] \lastnamedcs and \begincsname with empty csname

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jan 7 22:34:39 CET 2018


Hello,

Testing out how \lastnamedcs and \begincsname behave for some LaTeX 
kernel work, the following has come up:

\def\test#1{%
   \expandafter\def\csname #1\endcsname{abc}
   \message{\begincsname #1\endcsname}}
\test{x}
\test{y}
\test{}

\expandafter\let\expandafter\x\csname abc\endcsname
\show\x
\expandafter\show\lastnamedcs a

\expandafter\let\expandafter\x\csname hbox\endcsname
\show\x
\expandafter\show\lastnamedcs b


\expandafter\let\expandafter\x\csname\endcsname
\show\x
\expandafter\show\lastnamedcs c

\end

As you'll see, with an empty csname, both \lastnamedcs and \begincsname 
give (possibly) surprising results. Is this by-design?

Joseph


More information about the luatex mailing list