5

In expl3, the \str_case:Nn and \str_case:Vn variants are both pre-generated. In the interface3 document, it looks as though the \str_case:Vn variant were automatically generated from the \str_case:nn variant, whereas the \str_case:Nn variant seems to be its own separate implementation. Is there any difference in semantics or speed between the two variants?

1 Answer 1

5

Let me do

latexdef str_case:Nn str_case:Vn

The output is

\str_case:Nn:
\long macro:->\exp_args:NV \str_case:nn

\str_case:Vn:
\long macro:->\exp_args:NV \str_case:nn

so the two functions are exactly the same.

The Nn variant got added recently for consistency.

6
  • \str_case:Nn was added not long ago: github.com/latex3/latex3/issues/1071 Jun 10, 2022 at 23:02
  • 1
    @PhelypeOleinik Yes, I forgot about that one. But in the same vein we should also add \tl_if_blank:NTF besides \tl_if_blank:VTF.
    – egreg
    Jun 10, 2022 at 23:05
  • Indeed, good point Jun 10, 2022 at 23:09
  • Thank you. How did I not know about latexdef for the past 10 years?
    – Witiko
    Jun 10, 2022 at 23:18
  • 2
    @Witiko latexdef was added in TeX Live 2017; previously one had to call it texdef -t latex (which is still possible). The “long” form is necessary if you want to test other engines, such as xelatex or lualatex. A gift of our former moderator Martin Scharrer.
    – egreg
    Jun 10, 2022 at 23:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .