In LaTeX3 we got the \cs_prefix_spec:N, \cs_argument_spec:N and \cs_replacement_spec:N to analyse control sequences.
There is also the generic \cs_split_function:N, which splits a control sequence into its name and argument specification part.
But the first do not give us the possibility to obtain all information about the control sequence, namely the name is missing.
It is also not hard to give an implementation of the desired \cs_name_spec:N function that expands to the name of the function, e.g.
\cs_new:Npn \__cs_name_spec_aux:N #1
{
\use_i:nnn #1
}
\cs_new:Npn \cs_name_spec:N #1
{
\exp_args:Nx __cs_name_spec_aux:N { \cs_split_function:N #1 }
}
(I do not know this without the redirection without too much \exp_args)
So is there a good reason why this function is not included in the LaTeX3 kernel? From my point of view it would just complete the other three mentioned above.
\token_to_str:Nalready? – user202729 Jan 21 '22 at 01:47\: macros - How to get the string with \ - TeX - LaTeX Stack Exchange – user202729 Jan 21 '22 at 01:54:? – user202729 Jan 21 '22 at 01:56