diff options
author | Karl Berry <karl@freefriends.org> | 2023-05-11 20:14:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-05-11 20:14:09 +0000 |
commit | 7a09e4c0e22ea26b35881095ba56776b97353d6a (patch) | |
tree | 503de5dc343237630743ddac176faa1307c7d7c5 /Master/texmf-dist/source/latex/l3kernel | |
parent | 2fe9170cef7c130ec1dd170cdec3605ce3541c4d (diff) |
l3 (11may23)
git-svn-id: svn://tug.org/texlive/trunk@67074 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel')
57 files changed, 305 insertions, 338 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index dcdb6a23fb5..3b86288ffa0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2023-05-05}% +\def\ExplFileDate{2023-05-11}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 7febaf46539..2440b8ea32a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index e0846c06ecb..7c5e8f5e660 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index 379f42e9105..33b46834dbf 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 4c08d8e422c..4bbdc84bbb8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % @@ -86,24 +86,6 @@ % % \section{Additions to \pkg{l3seq}} % -% \begin{function}[rEXP] -% { -% \seq_mapthread_function:NNN, \seq_mapthread_function:NcN, -% \seq_mapthread_function:cNN, \seq_mapthread_function:ccN -% } -% \begin{syntax} -% \cs{seq_mapthread_function:NNN} \meta{seq_1} \meta{seq_2} \meta{function} -% \end{syntax} -% Applies \meta{function} to every pair of items -% \meta{seq_1-item}--\meta{seq_2-item} from the two sequences, returning -% items from both sequences from left to right. The \meta{function} -% receives two \texttt{n}-type arguments for each iteration. The mapping -% terminates when -% the end of either sequence is reached (\emph{i.e.}~whichever sequence has -% fewer items determines how many iterations -% occur). -% \end{function} -% % \begin{function}{\seq_set_filter:NNn, \seq_gset_filter:NNn} % \begin{syntax} % \cs{seq_set_filter:NNn} \meta{sequence_1} \meta{sequence_2} \Arg{inline boolexpr} @@ -119,42 +101,6 @@ % \end{texnote} % \end{function} % -% \begin{function}[added = 2021-04-29, noTF] -% {\seq_set_item:Nnn, \seq_set_item:cnn, \seq_gset_item:Nnn, \seq_gset_item:cnn} -% \begin{syntax} -% \cs{seq_set_item:Nnn} \meta{seq~var} \Arg{int expr} \Arg{item} -% \cs{seq_set_item:NnnTF} \meta{seq~var} \Arg{int expr} \Arg{item} \Arg{true code} \Arg{false code} -% \end{syntax} -% Removes the item of \meta{sequence} at the position given by -% evaluating the \meta{int expr} and replaces it by -% \meta{item}. Items are indexed from $1$ on the left/top of the -% \meta{sequence}, or from $-1$ on the right/bottom. If the -% \meta{int expr} is zero or is larger (in absolute value) -% than the number of items in the sequence, the \meta{sequence} is not -% modified. In these cases, \cs{seq_set_item:Nnn} raises an error -% while \cs{seq_set_item:NnnTF} runs the \meta{false code}. In cases -% where the assignment was successful, \meta{true code} is run -% afterwards. -% \end{function} -% -% \begin{function}[added = 2021-04-28, noTF] -% {\seq_pop_item:NnN, \seq_pop_item:cnN, \seq_gpop_item:NnN, \seq_gpop_item:cnN} -% \begin{syntax} -% \cs{seq_pop_item:NnN} \meta{seq~var} \Arg{int expr} \Arg{tl~var} -% \cs{seq_pop_item:NnNTF} \meta{seq~var} \Arg{int expr} \Arg{tl~var} \Arg{true code} \Arg{false code} -% \end{syntax} -% Removes the \meta{item} at position \meta{int expr} in the -% \meta{sequence}, and places it in the \meta{token list variable}. -% Items are indexed from $1$ on the left/top of the \meta{sequence}, -% or from $-1$ on the right/bottom. If the position is zero or is -% larger (in absolute value) than the number of items in the sequence, -% the \meta{seq~var} is not modified, the \meta{token list} is set to -% the special marker \cs{q_no_value}, and the \meta{false code} is -% left in the input stream; otherwise the \meta{true code} is. The -% \meta{token list} assignment is local while the \meta{sequence} is -% assigned locally for |pop| or globally for |gpop| functions. -% \end{function} -% % \section{Additions to \pkg{l3tl}} % % \begin{function}[added = 2018-04-01]{\tl_build_begin:N, \tl_build_gbegin:N} @@ -241,53 +187,6 @@ %<@@=seq> % \end{macrocode} % -% \begin{macro} -% { -% \seq_mapthread_function:NNN, \seq_mapthread_function:NcN, -% \seq_mapthread_function:cNN, \seq_mapthread_function:ccN -% } -% \begin{macro} -% { -% \@@_mapthread_function:wNN, \@@_mapthread_function:wNw, -% \@@_mapthread_function:Nnnwnn -% } -% The idea is to first expand both sequences, adding the -% usual |{ ? \prg_break: } { }| to the end of each one. This is -% most conveniently done in two steps using an auxiliary function. -% The mapping then throws away the first tokens of |#2| and |#5|, -% which for items in both sequences are \cs{s_@@} -% \cs{@@_item:n}. The function to be mapped are then be applied to -% the two entries. When the code hits the end of one of the -% sequences, the break material stops the entire loop and tidy up. -% This avoids needing to find the count of the two sequences, or -% worrying about which is longer. -% \begin{macrocode} -\cs_new:Npn \seq_mapthread_function:NNN #1#2#3 - { \exp_after:wN \@@_mapthread_function:wNN #2 \s_@@_stop #1 #3 } -\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \s_@@_stop #2#3 - { - \exp_after:wN \@@_mapthread_function:wNw #2 \s_@@_stop #3 - #1 { ? \prg_break: } { } - \prg_break_point: - } -\cs_new:Npn \@@_mapthread_function:wNw \s_@@ #1 \s_@@_stop #2 - { - \@@_mapthread_function:Nnnwnn #2 - #1 { ? \prg_break: } { } - \s_@@_stop - } -\cs_new:Npn \@@_mapthread_function:Nnnwnn #1#2#3#4 \s_@@_stop #5#6 - { - \use_none:n #2 - \use_none:n #5 - #1 {#3} {#6} - \@@_mapthread_function:Nnnwnn #1 #4 \s_@@_stop - } -\cs_generate_variant:Nn \seq_mapthread_function:NNN { Nc , c , cc } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}{\seq_set_filter:NNn, \seq_gset_filter:NNn} % \begin{macro}{\@@_set_filter:NNNn} % Similar to \cs{seq_map_inline:Nn}, without a @@ -312,176 +211,6 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_int_eval:w} -% Useful to more quickly go through items. -% \begin{macrocode} -\cs_new_eq:NN \@@_int_eval:w \tex_numexpr:D -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[noTF]{\seq_set_item:Nnn, \seq_set_item:cnn, \seq_gset_item:Nnn, \seq_gset_item:cnn} -% \begin{macro}{\@@_set_item:NnnNN, \@@_set_item:nnNNNN, \@@_set_item_false:nnNNNN, \@@_set_item:nNnnNNNN} -% \begin{macro}[rEXP]{\@@_set_item:wn, \@@_set_item_end:w} -% The conditionals are distinguished from the |Nnn| versions by the -% last argument \cs{use_ii:nn} vs \cs{use_i:nn}. -% \begin{macrocode} -\cs_new_protected:Npn \seq_set_item:Nnn #1#2#3 - { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_set:Nx \use_i:nn } -\cs_new_protected:Npn \seq_gset_item:Nnn #1#2#3 - { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_gset:Nx \use_i:nn } -\cs_generate_variant:Nn \seq_set_item:Nnn { c } -\cs_generate_variant:Nn \seq_gset_item:Nnn { c } -\prg_new_protected_conditional:Npnn \seq_set_item:Nnn #1#2#3 { TF , T , F } - { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_set:Nx \use_ii:nn } -\prg_new_protected_conditional:Npnn \seq_gset_item:Nnn #1#2#3 { TF , T , F } - { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_gset:Nx \use_ii:nn } -\prg_generate_conditional_variant:Nnn \seq_set_item:Nnn { c } { TF , T , F } -\prg_generate_conditional_variant:Nnn \seq_gset_item:Nnn { c } { TF , T , F } -% \end{macrocode} -% Save the item to be stored and evaluate the position and the sequence -% length only once. Then depending on the sign of the position, check -% that it is not bigger than the length (in absolute value) nor zero. -% \begin{macrocode} -\cs_new_protected:Npn \@@_set_item:NnnNN #1#2#3 - { - \tl_set:Nn \l_@@_internal_a_tl { \@@_item:n {#3} } - \exp_args:Nff \@@_set_item:nnNNNN - { \int_eval:n {#2} } { \seq_count:N #1 } #1 \use_none:nn - } -\cs_new_protected:Npn \@@_set_item:nnNNNN #1#2 - { - \int_compare:nNnTF {#1} > 0 - { \int_compare:nNnF {#1} > {#2} { \@@_set_item:nNnnNNNN { #1 - 1 } } } - { - \int_compare:nNnF {#1} < {-#2} - { - \int_compare:nNnF {#1} = 0 - { \@@_set_item:nNnnNNNN { #2 + #1 } } - } - } - \@@_set_item_false:nnNNNN {#1} {#2} - } -% \end{macrocode} -% If the position is not ok, \cs{@@_set_item_false:nnNNNN} calls an -% error or returns \texttt{false} (depending on the \cs{use_i:nn} vs -% \cs{use_ii:nn} argument mentioned above). -% \begin{macrocode} -\cs_new_protected:Npn \@@_set_item_false:nnNNNN #1#2#3#4#5#6 - { - #6 - { - \msg_error:nnxxx { seq } { item-too-large } - { \token_to_str:N #3 } {#2} {#1} - } - { \prg_return_false: } - } -\msg_new:nnnn { seq } { item-too-large } - { Sequence~'#1'~does~not~have~an~item~#3 } - { - An~attempt~was~made~to~push~or~pop~the~item~at~position~#3~ - of~'#1',~but~this~ - \int_compare:nTF { #3 = 0 } - { position~does~not~exist. } - { sequence~only~has~#2~item \int_compare:nF { #2 = 1 } {s}. } - } -% \end{macrocode} -% If the position is ok, \cs{@@_set_item:nNnnNNNN} makes the assignment -% and returns \texttt{true} (in the case of conditionnals). Here |#1| -% is an integer expression (position minus one), it needs to be -% evaluated. The sequence |#5| starts with \cs{s_@@} (even if empty), -% which stops the integer expression and is absorbed by it. The -% \cs{if_meaning:w} test is slightly faster than an integer test (but -% only works when testing against zero, hence the offset we chose in -% the position). When we are done skipping items, insert the saved -% item \cs{l_@@_internal_a_tl}. For |put| functions the last argument -% of \cs{@@_set_item_end:w} is \cs{use_none:nn} and it absorbs the -% item |#2| that we are removing: this is only useful for the |pop| -% functions. -% \begin{macrocode} -\cs_new_protected:Npn \@@_set_item:nNnnNNNN #1#2#3#4#5#6#7#8 - { - #7 #5 - { - \s_@@ - \exp_after:wN \@@_set_item:wn - \int_value:w \@@_int_eval:w #1 - #5 \s_@@_stop #6 - } - #8 { } { \prg_return_true: } - } -\cs_new:Npn \@@_set_item:wn #1 \@@_item:n #2 - { - \if_meaning:w 0 #1 \@@_set_item_end:w \fi: - \exp_not:n { \@@_item:n {#2} } - \exp_after:wN \@@_set_item:wn - \int_value:w \@@_int_eval:w #1 - 1 \s_@@ - } -\cs_new:Npn \@@_set_item_end:w #1 \exp_not:n #2 #3 \s_@@ #4 \s_@@_stop #5 - { - #1 - \exp_not:o \l_@@_internal_a_tl - \exp_not:n {#4} - #5 #2 - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}[noTF]{\seq_pop_item:NnN, \seq_pop_item:cnN, \seq_gpop_item:NnN, \seq_gpop_item:cnN} -% \begin{macro}{\@@_pop_item:NnNNN} -% The |NnN| versions simply call the conditionals, for which we will -% rely on the internals of \cs{seq_set_item:Nnn}. -% \begin{macrocode} -\cs_new_protected:Npn \seq_pop_item:NnN #1#2#3 - { \seq_pop_item:NnNTF #1 {#2} #3 { } { } } -\cs_new_protected:Npn \seq_gpop_item:NnN #1#2#3 - { \seq_gpop_item:NnNTF #1 {#2} #3 { } { } } -\cs_generate_variant:Nn \seq_pop_item:NnN { c } -\cs_generate_variant:Nn \seq_gpop_item:NnN { c } -\prg_new_protected_conditional:Npnn \seq_pop_item:NnN #1#2#3 { TF , T , F } - { \@@_pop_item:NnNN #1 {#2} #3 \__kernel_tl_set:Nx } -\prg_new_protected_conditional:Npnn \seq_gpop_item:NnN #1#2#3 { TF , T , F } - { \@@_pop_item:NnNN #1 {#2} #3 \__kernel_tl_gset:Nx } -\prg_generate_conditional_variant:Nnn \seq_pop_item:NnN { c } { TF , T , F } -\prg_generate_conditional_variant:Nnn \seq_gpop_item:NnN { c } { TF , T , F } -% \end{macrocode} -% Save in \cs{l_@@_internal_b_tl} the token list variable |#3| in -% which we will store the item. The \cs{@@_set_item:nnNNNN} auxiliary -% eventually inserts \cs{l_@@_internal_a_tl} in place of the item -% found in the sequence, so we empty that. Instead of the last -% argument \cs{use_i:nn} or \cs{use_ii:nn} used for |put| functions, -% we introduce \cs{@@_pop_item:nn}, which stores \cs{q_no_value} -% before calling its second argument -% (\cs{prg_return_true:}/\texttt{false:}) to end the conditional. The -% item found is passed to \cs{@@_pop_item_aux:w}, which interrupts the -% |x|-expanding sequence assignment and stores the item using the -% assignment function in \cs{l_@@_internal_b_tl}. -% \begin{macrocode} -\cs_new_protected:Npn \@@_pop_item:NnNN #1#2#3#4 - { - \tl_clear:N \l_@@_internal_a_tl - \tl_set:Nn \l_@@_internal_b_tl { \__kernel_tl_set:Nx #3 } - \exp_args:Nff \@@_set_item:nnNNNN - { \int_eval:n {#2} } { \seq_count:N #1 } - #1 \@@_pop_item_aux:w #4 \@@_pop_item:nn - } -\cs_new_protected:Npn \@@_pop_item:nn #1#2 - { - \if_meaning:w \prg_return_false: #2 - \l_@@_internal_b_tl { \exp_not:N \q_no_value } - \fi: - #2 - } -\cs_new:Npn \@@_pop_item_aux:w \@@_item:n #1 - { - \if_false: { \fi: } - \l_@@_internal_b_tl { \if_false: } \fi: \exp_not:n {#1} - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \subsection{Additions to \pkg{l3tl}} % % \subsubsection{Building a token list} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx index e379c5406ab..18dbc692382 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index 1aaeb463845..ff4f9f7197b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 0d640250103..66f601180dd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx index a38773626fe..e931d0b8712 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx index b189c0e9ecb..c0475ede4ed 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index 3e4bbca6d57..c1fe0db03a0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % @@ -529,6 +529,13 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\seq_mapthread_function:NNN} +% \begin{macrocode} +\__kernel_patch_deprecation:nnNNpn { 2023-05-10 } { \seq_mapthread_function:NNN } +\cs_gset:Npn \seq_mapthread_function:NNN { \seq_map_pairwise_function:NNN } +% \end{macrocode} +% \end{macro} +% % \subsection{Deprecated \pkg{l3sys} functions} % % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index c2b095f9191..6056a215d04 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -85,7 +85,7 @@ and all files in that bundle must be distributed together. % require you to do updates, if the class changes.}} % % \author{\Team} -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % \maketitle % \tableofcontents % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index 1431a78d3cd..e58953c8bb2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index 55f0b651598..8e6e06deeb1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 4d1b0660b7e..c5e7fc1df7f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % @@ -2815,8 +2815,8 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\file_full_name:n, \@@_full_name:n} -% \begin{macro}[EXP]{\@@_full_name_aux:nn} +% \begin{macro}[EXP]{\file_full_name:n, \@@_full_name:n, \@@_full_name_aux:n} +% \begin{macro}[EXP]{\@@_full_name_auxi:nn, \@@_full_name_auxii:nn} % \begin{macro}[EXP]{\@@_full_name_aux:Nnn} % \begin{macro}[EXP]{\@@_full_name_aux:nN} % \begin{macro}[EXP]{\@@_full_name_aux:nnN} @@ -2849,9 +2849,40 @@ \cs_new:Npn \@@_full_name:n #1 { \tl_if_blank:nF {#1} - { \exp_args:Nne \@@_full_name_aux:nn {#1} { \@@_size:n {#1} } } + { \exp_args:Nne \@@_full_name_auxii:nn {#1} { \@@_full_name_aux:n {#1} } } } -\cs_new:Npn \@@_full_name_aux:nn #1 #2 +% \end{macrocode} +% To avoid repeated reading of files we need to cache the loading: +% this is important as the code here is used by \emph{all} file checks. +% The same marker is used in the \LaTeXe{} kernel, meaning that we get a +% double-saving with for example \cs{IfFileExists}. As this is all about +% performance, we use the low-level approach for the conditionals. For +% a file already seen, the size is reported as $-1$ so it's distinct from +% any non-cached ones. +% \begin{macrocode} +\cs_new:Npn \@@_full_name_aux:n #1 + { + \if_cs_exist:w @@_seen_ \tl_to_str:n {#1} : \cs_end: + -1 + \else: + \exp_args:Ne \@@_full_name_auxi:nn { \@@_size:n {#1} } {#1} + \fi: + } +% \end{macrocode} +% We will need the size of files later, and we have to avoid the +% \cs{scan_stop:} causing issues if we are raising the flag. Thus there is +% a slightly odd gobble here. +% \begin{macrocode} +\cs_new:Npn \@@_full_name_auxi:nn #1#2 + { + \if:w \scan_stop: #1 \scan_stop: + \else: + \exp_after:wN \use_none:n + \cs:w @@_seen_ \tl_to_str:n {#2} : \cs_end: + #1 + \fi: + } +\cs_new:Npn \@@_full_name_auxii:nn #1 #2 { \tl_if_blank:nTF {#2} { @@ -2873,7 +2904,7 @@ \cs_new:Npn \@@_full_name_aux:Nnn #1#2#3 { \exp_args:Ne \@@_full_name_aux:nN { \tl_to_str:n {#3} / #2 } #1 } \cs_new:Npn \@@_full_name_aux:nN #1 - { \exp_args:Nne \@@_full_name_aux:nnN {#1} { \@@_size:n {#1} } } + { \exp_args:Nne \@@_full_name_aux:nnN {#1} { \@@_full_name_aux:n {#1} } } \cs_new:Npn \@@_full_name_aux:nnN #1 #2 #3 { \tl_if_blank:nF {#2} @@ -2913,14 +2944,15 @@ { #1 #3 } } \cs_new:Npn \@@_ext_check:nnn #1 - { \exp_args:Nne \@@_ext_check:nnnn {#1} { \@@_size:n {#1} } } + { \exp_args:Nne \@@_ext_check:nnnn {#1} { \@@_full_name_aux:n {#1} } } \cs_new:Npn \@@_ext_check:nnnn #1#2#3#4 { \tl_if_blank:nTF {#2} {#3} { - \int_compare:nNnTF - {#4} = {#2} + \bool_lazy_or:nnTF + { \int_compare_p:nNn {#4} = {#2} } + { \int_compare_p:nNn {#2} = { -1 } } {#1} {#3} } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index 98f74360d0f..581b7a72270 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index 03c018eec43..1fcd33b8d93 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index dcd9442da6a..b18b39218d7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index c9275deea4b..635ebbcdde5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index a9cf9298e76..6eb83223abf 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index d80f06d201a..99824f74a88 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index 1b87ecdc1b3..ca1372da430 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index cdbdb96f77b..ca76fecb2cb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index 4f745b04a3a..d3969b735c0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index 94313834bae..76c797e2eb2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 4e0f7fcd8f4..3ece03051c4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index 6ece5657278..7c2b5cf9577 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index bb6192a8c8e..991a56ec7a1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index b7ee984fa74..1d14dba2b62 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx index fbd5758a5c2..7311ad53584 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index bdfa2a63851..ca095b03595 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index d2af6940151..3cc0e52578c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx index 35441b1fdba..2bd0c676f02 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 4d5faa2af50..60645c83638 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx index c3024b4fba6..0b228b43338 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index cd31d0ebe25..e73b5cbe7c7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index f2705cf8bc6..bb739840dc6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % @@ -1991,6 +1991,15 @@ LaTeX~has~been~asked~to~create~a~new~scan~mark~'#1'~ but~this~name~has~already~been~used~for~a~scan~mark. } +\msg_new:nnnn { seq } { item-too-large } + { Sequence~'#1'~does~not~have~an~item~#3 } + { + An~attempt~was~made~to~push~or~pop~the~item~at~position~#3~ + of~'#1',~but~this~ + \int_compare:nTF { #3 = 0 } + { position~does~not~exist. } + { sequence~only~has~#2~item \int_compare:nF { #2 = 1 } {s}. } + } \msg_new:nnnn { seq } { shuffle-too-large } { The~sequence~#1~is~too~long~to~be~shuffled~by~TeX. } { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 7a04a58b0b4..1470671ec6c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx index aa22e822159..f3e7834b6e7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index 1324b1eb42d..83b2904740f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % @@ -654,7 +654,7 @@ % The \meta{code} associated to this first case is left in the input % stream, followed by the \meta{true code}, and other cases are % discarded. If none of the cases match then only the \meta{false -% code} is inserted. The function \cs{bool_case_true:n}, +% code} is inserted. The function \cs{bool_case:n}, % which does nothing if there is no match, is % also available. For example % \begin{verbatim} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index da3a73a51c2..297fcd877fd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index a039cf8a973..fda47356efc 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index b2443a4b27e..46629fc8d63 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index e4aeffa83ff..d5d0a521460 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % @@ -474,6 +474,24 @@ % \cs{tl_if_eq:nnTF}. % \end{function} % +% \begin{function}[added = 2021-04-29, noTF] +% {\seq_set_item:Nnn, \seq_set_item:cnn, \seq_gset_item:Nnn, \seq_gset_item:cnn} +% \begin{syntax} +% \cs{seq_set_item:Nnn} \meta{seq~var} \Arg{int expr} \Arg{item} +% \cs{seq_set_item:NnnTF} \meta{seq~var} \Arg{int expr} \Arg{item} \Arg{true code} \Arg{false code} +% \end{syntax} +% Removes the item of \meta{sequence} at the position given by +% evaluating the \meta{int expr} and replaces it by +% \meta{item}. Items are indexed from $1$ on the left/top of the +% \meta{sequence}, or from $-1$ on the right/bottom. If the +% \meta{int expr} is zero or is larger (in absolute value) +% than the number of items in the sequence, the \meta{sequence} is not +% modified. In these cases, \cs{seq_set_item:Nnn} raises an error +% while \cs{seq_set_item:NnnTF} runs the \meta{false code}. In cases +% where the assignment was successful, \meta{true code} is run +% afterwards. +% \end{function} +% % \begin{function}[added = 2014-07-18] % { % \seq_reverse:N, \seq_reverse:c, @@ -621,6 +639,24 @@ % and so on) as~|#1| and the \meta{item} as~|#2|. % \end{function} % +% \begin{function}[rEXP, added = 2023-05-10] +% { +% \seq_map_pairwise_function:NNN, \seq_map_pairwise_function:NcN, +% \seq_map_pairwise_function:cNN, \seq_map_pairwise_function:ccN +% } +% \begin{syntax} +% \cs{seq_map_pairwise_function:NNN} \meta{seq_1} \meta{seq_2} \meta{function} +% \end{syntax} +% Applies \meta{function} to every pair of items +% \meta{seq_1-item}--\meta{seq_2-item} from the two sequences, returning +% items from both sequences from left to right. The \meta{function} +% receives two \texttt{n}-type arguments for each iteration. The mapping +% terminates when +% the end of either sequence is reached (\emph{i.e.}~whichever sequence has +% fewer items determines how many iterations +% occur). +% \end{function} +% % \begin{function}[rEXP, updated = 2012-06-29]{\seq_map_break:} % \begin{syntax} % \cs{seq_map_break:} @@ -1513,6 +1549,113 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\@@_int_eval:w} +% Useful to more quickly go through items. +% \begin{macrocode} +\cs_new_eq:NN \@@_int_eval:w \tex_numexpr:D +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[noTF]{\seq_set_item:Nnn, \seq_set_item:cnn, \seq_gset_item:Nnn, \seq_gset_item:cnn} +% \begin{macro}{\@@_set_item:NnnNN, \@@_set_item:nnNNNN, \@@_set_item_false:nnNNNN, \@@_set_item:nNnnNNNN} +% \begin{macro}[rEXP]{\@@_set_item:wn, \@@_set_item_end:w} +% The conditionals are distinguished from the |Nnn| versions by the +% last argument \cs{use_ii:nn} vs \cs{use_i:nn}. +% \begin{macrocode} +\cs_new_protected:Npn \seq_set_item:Nnn #1#2#3 + { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_set:Nx \use_i:nn } +\cs_new_protected:Npn \seq_gset_item:Nnn #1#2#3 + { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_gset:Nx \use_i:nn } +\cs_generate_variant:Nn \seq_set_item:Nnn { c } +\cs_generate_variant:Nn \seq_gset_item:Nnn { c } +\prg_new_protected_conditional:Npnn \seq_set_item:Nnn #1#2#3 { TF , T , F } + { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_set:Nx \use_ii:nn } +\prg_new_protected_conditional:Npnn \seq_gset_item:Nnn #1#2#3 { TF , T , F } + { \@@_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_gset:Nx \use_ii:nn } +\prg_generate_conditional_variant:Nnn \seq_set_item:Nnn { c } { TF , T , F } +\prg_generate_conditional_variant:Nnn \seq_gset_item:Nnn { c } { TF , T , F } +% \end{macrocode} +% Save the item to be stored and evaluate the position and the sequence +% length only once. Then depending on the sign of the position, check +% that it is not bigger than the length (in absolute value) nor zero. +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_item:NnnNN #1#2#3 + { + \tl_set:Nn \l_@@_internal_a_tl { \@@_item:n {#3} } + \exp_args:Nff \@@_set_item:nnNNNN + { \int_eval:n {#2} } { \seq_count:N #1 } #1 \use_none:nn + } +\cs_new_protected:Npn \@@_set_item:nnNNNN #1#2 + { + \int_compare:nNnTF {#1} > 0 + { \int_compare:nNnF {#1} > {#2} { \@@_set_item:nNnnNNNN { #1 - 1 } } } + { + \int_compare:nNnF {#1} < {-#2} + { + \int_compare:nNnF {#1} = 0 + { \@@_set_item:nNnnNNNN { #2 + #1 } } + } + } + \@@_set_item_false:nnNNNN {#1} {#2} + } +% \end{macrocode} +% If the position is not ok, \cs{@@_set_item_false:nnNNNN} calls an +% error or returns \texttt{false} (depending on the \cs{use_i:nn} vs +% \cs{use_ii:nn} argument mentioned above). +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_item_false:nnNNNN #1#2#3#4#5#6 + { + #6 + { + \msg_error:nnxxx { seq } { item-too-large } + { \token_to_str:N #3 } {#2} {#1} + } + { \prg_return_false: } + } +% \end{macrocode} +% If the position is ok, \cs{@@_set_item:nNnnNNNN} makes the assignment +% and returns \texttt{true} (in the case of conditionnals). Here |#1| +% is an integer expression (position minus one), it needs to be +% evaluated. The sequence |#5| starts with \cs{s_@@} (even if empty), +% which stops the integer expression and is absorbed by it. The +% \cs{if_meaning:w} test is slightly faster than an integer test (but +% only works when testing against zero, hence the offset we chose in +% the position). When we are done skipping items, insert the saved +% item \cs{l_@@_internal_a_tl}. For |put| functions the last argument +% of \cs{@@_set_item_end:w} is \cs{use_none:nn} and it absorbs the +% item |#2| that we are removing: this is only useful for the |pop| +% functions. +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_item:nNnnNNNN #1#2#3#4#5#6#7#8 + { + #7 #5 + { + \s_@@ + \exp_after:wN \@@_set_item:wn + \int_value:w \@@_int_eval:w #1 + #5 \s_@@_stop #6 + } + #8 { } { \prg_return_true: } + } +\cs_new:Npn \@@_set_item:wn #1 \@@_item:n #2 + { + \if_meaning:w 0 #1 \@@_set_item_end:w \fi: + \exp_not:n { \@@_item:n {#2} } + \exp_after:wN \@@_set_item:wn + \int_value:w \@@_int_eval:w #1 - 1 \s_@@ + } +\cs_new:Npn \@@_set_item_end:w #1 \exp_not:n #2 #3 \s_@@ #4 \s_@@_stop #5 + { + #1 + \exp_not:o \l_@@_internal_a_tl + \exp_not:n {#4} + #5 #2 + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro} % {\seq_reverse:N, \seq_reverse:c, \seq_greverse:N, \seq_greverse:c} % \begin{macro}{\@@_reverse:NN} @@ -2160,6 +2303,53 @@ % \end{macrocode} % \end{macro} % +% \begin{macro} +% { +% \seq_map_pairwise_function:NNN, \seq_map_pairwise_function:NcN, +% \seq_map_pairwise_function:cNN, \seq_map_pairwise_function:ccN +% } +% \begin{macro} +% { +% \@@_map_pairwise_function:wNN, \@@_map_pairwise_function:wNw, +% \@@_map_pairwise_function:Nnnwnn +% } +% The idea is to first expand both sequences, adding the +% usual |{ ? \prg_break: } { }| to the end of each one. This is +% most conveniently done in two steps using an auxiliary function. +% The mapping then throws away the first tokens of |#2| and |#5|, +% which for items in both sequences are \cs{s_@@} +% \cs{@@_item:n}. The function to be mapped are then be applied to +% the two entries. When the code hits the end of one of the +% sequences, the break material stops the entire loop and tidy up. +% This avoids needing to find the count of the two sequences, or +% worrying about which is longer. +% \begin{macrocode} +\cs_new:Npn \seq_map_pairwise_function:NNN #1#2#3 + { \exp_after:wN \@@_map_pairwise_function:wNN #2 \s_@@_stop #1 #3 } +\cs_new:Npn \@@_map_pairwise_function:wNN \s_@@ #1 \s_@@_stop #2#3 + { + \exp_after:wN \@@_map_pairwise_function:wNw #2 \s_@@_stop #3 + #1 { ? \prg_break: } { } + \prg_break_point: + } +\cs_new:Npn \@@_map_pairwise_function:wNw \s_@@ #1 \s_@@_stop #2 + { + \@@_map_pairwise_function:Nnnwnn #2 + #1 { ? \prg_break: } { } + \s_@@_stop + } +\cs_new:Npn \@@_map_pairwise_function:Nnnwnn #1#2#3#4 \s_@@_stop #5#6 + { + \use_none:n #2 + \use_none:n #5 + #1 {#3} {#6} + \@@_map_pairwise_function:Nnnwnn #1 #4 \s_@@_stop + } +\cs_generate_variant:Nn \seq_map_pairwise_function:NNN { Nc , c , cc } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}{\seq_set_map_x:NNn, \seq_gset_map_x:NNn} % \begin{macro}{\@@_set_map_x:NNNn} % Very similar to \cs{seq_set_filter:NNn}. We could actually diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 2d18a850d52..808807483ac 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index 80be229f409..72db7d8c42d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx index abaeb6d72a3..f71d2cb47e7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index 603af986076..e199e98b94c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index 6125c76928b..6f64b5ea4c3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx index 3a71dd4b014..0dc9db24ed8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx index ef93deb9093..958ac7370e6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx index 35c73a621aa..799d676b13f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx index d9057ea51f1..11fe78a2025 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index c9beca06a3c..127aaaab2a9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 741463fee8e..6f0eb9f39e1 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 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index dad206a4066..77e94d5b25f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx index 7c10f177919..fc3a2ba5e07 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-05} +% \date{Released 2023-05-11} % % \maketitle % |