diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3tl.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3tl.dtx | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index b10167ca25d..c315612b435 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-06-18} +% \date{Released 2020-07-17} % % \maketitle % @@ -305,7 +305,8 @@ % This allows the \meta{tl~var} to contain material % with category codes other than those that apply when \meta{tokens} % are absorbed. The \meta{setup} is run within a group and may -% contain any valid input, although only changes in category codes +% contain any valid input, although only changes in category codes, +% such as uses of \cs{cctab_select:N}, % are relevant. See also \cs{tl_rescan:nn}. % \begin{texnote} % The \meta{tokens} are first turned into a string (using @@ -332,7 +333,8 @@ % by the \meta{setup} are those in force at the point of use of % \cs{tl_rescan:nn}.) % The \meta{setup} is run within a group and may -% contain any valid input, although only changes in category codes +% contain any valid input, although only changes in category codes, +% such as uses of \cs{cctab_select:N}, % are relevant. See also \cs{tl_set_rescan:Nnn}, which is more % robust than using \cs{tl_set:Nn} in the \meta{tokens} argument of % \cs{tl_rescan:nn}. @@ -401,6 +403,19 @@ % \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl { true } { false } % \end{verbatim} % yields \texttt{false}. +% See also \cs{str_if_eq:nnTF} for a comparison that ignores category codes. +% \end{function} +% +% \begin{function}[TF, added = 2020-07-14]{\tl_if_eq:Nn, \tl_if_eq:cn} +% \begin{syntax} +% \cs{tl_if_eq:NnTF} \meta{tl~var_1} \Arg{token list_2} \Arg{true code} \Arg{false code} +% \end{syntax} +% Tests if the \meta{token list variable_1} and the \meta{token +% list_2} contain the same list of tokens, both in respect of +% character codes and category codes. This conditional is not +% expandable: see \cs{tl_if_eq:NNTF} for an expandable version when +% both token lists are stored in variables, or \cs{str_if_eq:nnTF} if +% category codes are not important. % \end{function} % % \begin{function}[TF]{\tl_if_eq:nn} @@ -409,7 +424,9 @@ % \end{syntax} % Tests if \meta{token list_1} and \meta{token list_2} contain the % same list of tokens, both in respect of character codes and category -% codes. +% codes. This conditional is not expandable: see \cs{tl_if_eq:NNTF} +% for an expandable version when token lists are stored in variables, +% or \cs{str_if_eq:nnTF} if category codes are not important. % \end{function} % % \begin{function}[TF]{\tl_if_in:Nn, \tl_if_in:cn} @@ -1203,7 +1220,7 @@ % will \emph{not} match the simple text input |-NoValue-|, \emph{i.e.} % that % \begin{verbatim} -% \tl_if_eq:VnTF \c_novalue_tl { -NoValue- } +% \tl_if_eq:NnTF \c_novalue_tl { -NoValue- } % \end{verbatim} % is logically \texttt{false}. The \cs{c_novalue_tl} marker is intended for % use in creating document-level interfaces, where it serves as an indicator @@ -2125,8 +2142,34 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[TF]{\tl_if_eq:nn} % \begin{variable}{\l_@@_internal_a_tl, \l_@@_internal_b_tl} +% Temporary storage. +% \begin{macrocode} +\tl_new:N \l_@@_internal_a_tl +\tl_new:N \l_@@_internal_b_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[TF]{\tl_if_eq:Nn} +% A simple store and compare routine. +% \begin{macrocode} +\prg_new_protected_conditional:Npnn \tl_if_eq:Nn #1#2 { T , F , TF } + { + \group_begin: + \tl_set:Nn \l_@@_internal_b_tl {#2} + \exp_after:wN + \group_end: + \if_meaning:w #1 \l_@@_internal_b_tl + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +\prg_generate_conditional_variant:Nnn \tl_if_eq:Nn { c } { TF , T , F } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[TF]{\tl_if_eq:nn} % A simple store and compare routine. % \begin{macrocode} \prg_new_protected_conditional:Npnn \tl_if_eq:nn #1#2 { T , F , TF } @@ -2142,10 +2185,7 @@ \prg_return_false: \fi: } -\tl_new:N \l_@@_internal_a_tl -\tl_new:N \l_@@_internal_b_tl % \end{macrocode} -% \end{variable} % \end{macro} % % \begin{macro}[TF]{\tl_if_in:Nn, \tl_if_in:cn} |