1

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.

1 Answers1

2

This is at-least in part historical, but largely reflects what has been useful for the team. \cs_split_function:N is needed to implement \cs_generate_variant:Nn and other core functions, and there one needs both parts of a function name. On the other hand, \cs_prefix_spec:N, are rather more specialist, but have been useful. We've not needed to get 'just the name', so haven't added a dedicated function in that area.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036