[latex3-commits] [latex3/latex3] main: Rename \seq_mapthread_function:NNN to (stable) "map_pairwise" equiv (6199b31f0)
github at latex-project.org
github at latex-project.org
Wed May 10 22:25:58 CEST 2023
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/6199b31f00ffab096ffc81c3cf7906071c323e08
>---------------------------------------------------------------
commit 6199b31f00ffab096ffc81c3cf7906071c323e08
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed May 10 21:25:58 2023 +0100
Rename \seq_mapthread_function:NNN to (stable) "map_pairwise" equiv
>---------------------------------------------------------------
6199b31f00ffab096ffc81c3cf7906071c323e08
l3experimental/CHANGELOG.md | 3 ++
l3experimental/xgalley/l3galley.dtx | 2 +-
l3kernel/CHANGELOG.md | 6 +++-
l3kernel/l3candidates.dtx | 65 -------------------------------------
l3kernel/l3deprecation.dtx | 7 ++++
l3kernel/l3seq.dtx | 65 +++++++++++++++++++++++++++++++++++++
l3kernel/testfiles/m3seq008.lvt | 14 ++++----
l3kernel/testfiles/m3seq008.tlg | 2 +-
l3trial/l3check/l3check.dtx | 4 +--
9 files changed, 91 insertions(+), 77 deletions(-)
diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index fa3928d93..26caff23f 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+- Track `expl3` core changes
+
## [2023-04-19]
### Added
diff --git a/l3experimental/xgalley/l3galley.dtx b/l3experimental/xgalley/l3galley.dtx
index 5ad2b5c90..0f7a8bcff 100644
--- a/l3experimental/xgalley/l3galley.dtx
+++ b/l3experimental/xgalley/l3galley.dtx
@@ -1834,7 +1834,7 @@
\tex_parshape:D
\int_min:nn { \seq_count:N #1 } { \seq_count:N #2 }
\exp_stop_f:
- \seq_mapthread_function:NNN #1 #2
+ \seq_map_pairwise_function:NNN #1 #2
\@@_parshape_set_indents:nn
}
\cs_new:Npn \@@_parshape_set_indents:nn #1#2
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index fd02e7e05..88aa8f257 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,12 +7,16 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Added
+- `\seq_map_pairwise_function:NNN` (renamed from `\seq_mapthread_function:NNN`)
+
### Changed
- Moved `\seq_set_item:Nnn` to stable status
### Removed
- Experimental function `\seq_pop_item:NnN` from `l3candidates`
-
+- Experimental function `\seq_mapthread_function:NNN` now renamed
+ `\seq_map_pairwise_function:NNN`
## [2023-05-05]
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 3c8239066..7584ac83b 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -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}
@@ -205,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
diff --git a/l3kernel/l3deprecation.dtx b/l3kernel/l3deprecation.dtx
index 3e4bbca6d..bab03905f 100644
--- a/l3kernel/l3deprecation.dtx
+++ b/l3kernel/l3deprecation.dtx
@@ -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/l3kernel/l3seq.dtx b/l3kernel/l3seq.dtx
index 7c62b8c36..ebf8273ba 100644
--- a/l3kernel/l3seq.dtx
+++ b/l3kernel/l3seq.dtx
@@ -639,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:}
@@ -2285,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/l3kernel/testfiles/m3seq008.lvt b/l3kernel/testfiles/m3seq008.lvt
index 59749a4c1..1249b944f 100644
--- a/l3kernel/testfiles/m3seq008.lvt
+++ b/l3kernel/testfiles/m3seq008.lvt
@@ -38,19 +38,19 @@
\cs_set:Npn \test:nn #1#2 { \TYPE { " \tl_to_str:n {#1} ":"\tl_to_str:n {#2}" } \NEWLINE }
\TIMO
-\TESTEXP { seq_mapthread_function:NNN }
+\TESTEXP { seq_map_pairwise_function:NNN }
{
- \seq_mapthread_function:NNN \l_tmpa_seq \l_tmpb_seq \test:nn
+ \seq_map_pairwise_function:NNN \l_tmpa_seq \l_tmpb_seq \test:nn
\SEPARATOR \NEWLINE
- \seq_mapthread_function:NNN \l_tmpb_seq \l_tmpa_seq \test:nn
+ \seq_map_pairwise_function:NNN \l_tmpb_seq \l_tmpa_seq \test:nn
\SEPARATOR \NEWLINE
- \seq_mapthread_function:NNN \g_tmpa_seq \l_tmpb_seq \test:nn
+ \seq_map_pairwise_function:NNN \g_tmpa_seq \l_tmpb_seq \test:nn
\SEPARATOR \NEWLINE
- \seq_mapthread_function:NNN \l_tmpb_seq \g_tmpa_seq \test:nn
+ \seq_map_pairwise_function:NNN \l_tmpb_seq \g_tmpa_seq \test:nn
\SEPARATOR \NEWLINE
- \seq_mapthread_function:NNN \g_tmpb_seq \l_tmpb_seq \test:nn
+ \seq_map_pairwise_function:NNN \g_tmpb_seq \l_tmpb_seq \test:nn
\SEPARATOR \NEWLINE
- \seq_mapthread_function:NNN \l_tmpb_seq \g_tmpb_seq \test:nn
+ \seq_map_pairwise_function:NNN \l_tmpb_seq \g_tmpb_seq \test:nn
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/l3kernel/testfiles/m3seq008.tlg b/l3kernel/testfiles/m3seq008.tlg
index 805b4362f..8722736cd 100644
--- a/l3kernel/testfiles/m3seq008.tlg
+++ b/l3kernel/testfiles/m3seq008.tlg
@@ -2,7 +2,7 @@ This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Joseph Wright, Bruno Le Floch
============================================================
-TEST 1: seq_mapthread_function:NNN
+TEST 1: seq_map_pairwise_function:NNN
============================================================
"c":"{C}"
"b":" B"
diff --git a/l3trial/l3check/l3check.dtx b/l3trial/l3check/l3check.dtx
index 35b4fd44a..92ebd3bf2 100644
--- a/l3trial/l3check/l3check.dtx
+++ b/l3trial/l3check/l3check.dtx
@@ -1,6 +1,6 @@
% \iffalse
%
-%% File l3check.dtx (C) Copyright 2012-2021 The LaTeX Project
+%% File l3check.dtx (C) Copyright 2012-2021,2023 The LaTeX Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -1748,7 +1748,7 @@
% |\seq_if_(exist/empty):(N/c)|(TF), |\seq_(g/)remove_duplicates:N|,
% |\seq_if_in:Nn|(TF), |\seq_item:Nn|, |\seq_count:N|,
% |\seq_use:Nn(/nn)|, |\seq_map_function:NN|,
-% |\seq_mapthread_function:NNN|, |\seq_map_inline:Nn|,
+% |\seq_map_pairwise_function:NNN|, |\seq_map_inline:Nn|,
% |\seq_map_variable:NNn|, |\seq_(show/log):N|
%
% The following abuse |\tl_(g/)set:N(n/x/f)|:
More information about the latex3-commits
mailing list.