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

Reply via email to