[latex3-commits] [git/LaTeX3-latex3-latex3] seq_indexed_map: Move \seq_indexed_map_(inline|function):Nn to stable (86bde3d3c)

PhelypeOleinik tex.phelype at gmail.com
Mon Jun 15 16:12:27 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : seq_indexed_map
Link       : https://github.com/latex3/latex3/commit/86bde3d3c07caee88d827654dfe9bd72de772b70

>---------------------------------------------------------------

commit 86bde3d3c07caee88d827654dfe9bd72de772b70
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Mon Jun 15 11:12:27 2020 -0300

    Move \seq_indexed_map_(inline|function):Nn to stable


>---------------------------------------------------------------

86bde3d3c07caee88d827654dfe9bd72de772b70
 l3kernel/CHANGELOG.md     |  4 +++
 l3kernel/l3candidates.dtx | 64 -----------------------------------------------
 l3kernel/l3seq.dtx        | 64 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 64 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index fce45da35..4742e2e02 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Moved `\seq_indexed_map_inline:Nn` and `\seq_indexed_map_function:Nn`
+  to stable.
+
 ## [2020-06-03]
 
 ### Added
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 5b9533868..ef891b7fa 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -520,26 +520,6 @@
 %   mappings.
 % \end{function}
 %
-% \begin{function}[rEXP,added = 2018-05-03]{\seq_indexed_map_function:NN}
-%   \begin{syntax}
-%     \cs{seq_indexed_map_function:NN} \meta{seq~var} \meta{function}
-%   \end{syntax}
-%   Applies \meta{function} to every entry in the \meta{sequence
-%   variable}.  The \meta{function} should have signature |:nn|.  It
-%   receives two arguments for each iteration: the \meta{index} (namely
-%   |1| for the first entry, then |2| and so on) and the \meta{item}.
-% \end{function}
-%
-% \begin{function}[added = 2018-05-03]{\seq_indexed_map_inline:Nn}
-%   \begin{syntax}
-%     \cs{seq_indexed_map_inline:Nn} \meta{seq~var} \Arg{inline function}
-%   \end{syntax}
-%   Applies \meta{inline function} to every entry in the \meta{sequence
-%   variable}.  The \meta{inline function} should consist of code which
-%   receives the \meta{index} (namely |1| for the first entry, then |2|
-%   and so on) as~|#1| and the \meta{item} as~|#2|.
-% \end{function}
-%
 % \section{Additions to \pkg{l3sys}}
 %
 % \begin{variable}[added = 2018-05-02]{\c_sys_engine_version_str}
@@ -1301,50 +1281,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}
-%   {
-%     \seq_indexed_map_function:NN, \seq_indexed_map_inline:Nn,
-%     \@@_indexed_map:nNN, \@@_indexed_map:Nw
-%   }
-%   Similar to \cs{seq_map_function:NN} but we keep track of the item
-%   index as a |;|-delimited argument of \cs{@@_indexed_map:Nw}.
-%    \begin{macrocode}
-\cs_new:Npn \seq_indexed_map_function:NN #1#2
-  {
-    \@@_indexed_map:NN #1#2
-    \prg_break_point:Nn \seq_map_break: { }
-  }
-\cs_new_protected:Npn \seq_indexed_map_inline:Nn #1#2
-  {
-    \int_gincr:N \g__kernel_prg_map_int
-    \cs_gset_protected:cpn
-      { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1##2 {#2}
-    \exp_args:NNc \@@_indexed_map:NN #1
-      { @@_map_ \int_use:N \g__kernel_prg_map_int :w }
-    \prg_break_point:Nn \seq_map_break:
-      { \int_gdecr:N \g__kernel_prg_map_int }
-  }
-\cs_new:Npn \@@_indexed_map:NN #1#2
-  {
-    \exp_after:wN \@@_indexed_map:Nw
-    \exp_after:wN #2
-    \int_value:w 1
-    \exp_after:wN \use_i:nn
-    \exp_after:wN ;
-    #1
-    \prg_break: \@@_item:n { } \prg_break_point:
-  }
-\cs_new:Npn \@@_indexed_map:Nw #1#2 ; #3 \@@_item:n #4
-  {
-    #3
-    #1 {#2} {#4}
-    \exp_after:wN \@@_indexed_map:Nw
-    \exp_after:wN #1
-    \int_value:w \int_eval:w 1 + #2 ;
-  }
-%    \end{macrocode}
-% \end{macro}
-%
 % \subsection{Additions to \pkg{l3sys}}
 %
 %    \begin{macrocode}
diff --git a/l3kernel/l3seq.dtx b/l3kernel/l3seq.dtx
index 7b2121719..1b0f05782 100644
--- a/l3kernel/l3seq.dtx
+++ b/l3kernel/l3seq.dtx
@@ -578,6 +578,26 @@
 %   \meta{items} are returned from left to right.
 % \end{function}
 %
+% \begin{function}[rEXP,added = 2018-05-03]{\seq_indexed_map_function:NN}
+%   \begin{syntax}
+%     \cs{seq_indexed_map_function:NN} \meta{seq~var} \meta{function}
+%   \end{syntax}
+%   Applies \meta{function} to every entry in the \meta{sequence
+%   variable}.  The \meta{function} should have signature |:nn|.  It
+%   receives two arguments for each iteration: the \meta{index} (namely
+%   |1| for the first entry, then |2| and so on) and the \meta{item}.
+% \end{function}
+%
+% \begin{function}[added = 2018-05-03]{\seq_indexed_map_inline:Nn}
+%   \begin{syntax}
+%     \cs{seq_indexed_map_inline:Nn} \meta{seq~var} \Arg{inline function}
+%   \end{syntax}
+%   Applies \meta{inline function} to every entry in the \meta{sequence
+%   variable}.  The \meta{inline function} should consist of code which
+%   receives the \meta{index} (namely |1| for the first entry, then |2|
+%   and so on) as~|#1| and the \meta{item} as~|#2|.
+% \end{function}
+%
 % \begin{function}[rEXP, updated = 2012-06-29]{\seq_map_break:}
 %   \begin{syntax}
 %     \cs{seq_map_break:}
@@ -2018,6 +2038,50 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}
+%   {
+%     \seq_indexed_map_function:NN, \seq_indexed_map_inline:Nn,
+%     \@@_indexed_map:nNN, \@@_indexed_map:Nw
+%   }
+%   Similar to \cs{seq_map_function:NN} but we keep track of the item
+%   index as a |;|-delimited argument of \cs{@@_indexed_map:Nw}.
+%    \begin{macrocode}
+\cs_new:Npn \seq_indexed_map_function:NN #1#2
+  {
+    \@@_indexed_map:NN #1#2
+    \prg_break_point:Nn \seq_map_break: { }
+  }
+\cs_new_protected:Npn \seq_indexed_map_inline:Nn #1#2
+  {
+    \int_gincr:N \g__kernel_prg_map_int
+    \cs_gset_protected:cpn
+      { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1##2 {#2}
+    \exp_args:NNc \@@_indexed_map:NN #1
+      { @@_map_ \int_use:N \g__kernel_prg_map_int :w }
+    \prg_break_point:Nn \seq_map_break:
+      { \int_gdecr:N \g__kernel_prg_map_int }
+  }
+\cs_new:Npn \@@_indexed_map:NN #1#2
+  {
+    \exp_after:wN \@@_indexed_map:Nw
+    \exp_after:wN #2
+    \int_value:w 1
+    \exp_after:wN \use_i:nn
+    \exp_after:wN ;
+    #1
+    \prg_break: \@@_item:n { } \prg_break_point:
+  }
+\cs_new:Npn \@@_indexed_map:Nw #1#2 ; #3 \@@_item:n #4
+  {
+    #3
+    #1 {#2} {#4}
+    \exp_after:wN \@@_indexed_map:Nw
+    \exp_after:wN #1
+    \int_value:w \int_eval:w 1 + #2 ;
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\seq_count:N, \seq_count:c}
 % \begin{macro}{\@@_count:w, \@@_count_end:w}
 %   Since counting the items in a sequence is quite common, we optimize





More information about the latex3-commits mailing list.