summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3seq.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3seq.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3seq.dtx39
1 files changed, 28 insertions, 11 deletions
diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx
index 18e954d9e1..a8bd4d97e6 100644
--- a/macros/latex/contrib/l3kernel/l3seq.dtx
+++ b/macros/latex/contrib/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-05-11}
+% \date{Released 2021-05-25}
%
% \maketitle
%
@@ -1979,10 +1979,11 @@
%
% \begin{macro}{\seq_map_function:NN, \seq_map_function:cN}
% \UnitTested
-% \begin{macro}[rEXP]{\@@_map_function:NNn}
+% \begin{macro}[rEXP]{\@@_map_function:Nw}
% The idea here is to apply the code of |#2| to each item in the
% sequence without altering the definition of \cs{@@_item:n}. The
-% argument delimited by \cs{@@_item:n} is almost always empty, except
+% even-numbered arguments of \cs{@@_map_function:Nw} delimited by
+% \cs{@@_item:n} are almost always empty, except
% at the end of the loop where it is \cs{prg_break:}. This allows to
% break the loop without needing to do a (relatively-expensive) quark
% test.
@@ -1993,13 +1994,21 @@
\exp_after:wN \@@_map_function:Nw
\exp_after:wN #2
#1
- \prg_break: \@@_item:n { } \prg_break_point:
+ \prg_break:
+ \@@_item:n { } \@@_item:n { } \@@_item:n { } \@@_item:n { }
+ \prg_break_point:
\prg_break_point:Nn \seq_map_break: { }
}
-\cs_new:Npn \@@_map_function:Nw #1#2 \@@_item:n #3
+\cs_new:Npn \@@_map_function:Nw #1
+ #2 \@@_item:n #3
+ #4 \@@_item:n #5
+ #6 \@@_item:n #7
+ #8 \@@_item:n #9
{
- #2
- #1 {#3}
+ #2 #1 {#3}
+ #4 #1 {#5}
+ #6 #1 {#7}
+ #8 #1 {#9}
\@@_map_function:Nw #1
}
\cs_generate_variant:Nn \seq_map_function:NN { c }
@@ -2068,14 +2077,22 @@
{
\exp_last_unbraced:Nno
\use_i:nn { \@@_map_tokens:nw {#2} } #1
- \prg_break: \@@_item:n { } \prg_break_point:
+ \prg_break:
+ \@@_item:n { } \@@_item:n { } \@@_item:n { } \@@_item:n { }
+ \prg_break_point:
\prg_break_point:Nn \seq_map_break: { }
}
\cs_generate_variant:Nn \seq_map_tokens:Nn { c }
-\cs_new:Npn \@@_map_tokens:nw #1#2 \@@_item:n #3
+\cs_new:Npn \@@_map_tokens:nw #1
+ #2 \@@_item:n #3
+ #4 \@@_item:n #5
+ #6 \@@_item:n #7
+ #8 \@@_item:n #9
{
- #2
- \use:n {#1} {#3}
+ #2 \use:n {#1} {#3}
+ #4 \use:n {#1} {#5}
+ #6 \use:n {#1} {#7}
+ #8 \use:n {#1} {#9}
\@@_map_tokens:nw {#1}
}
% \end{macrocode}