[latex3-commits] [git/LaTeX3-latex3-latex3] master: Implement \intarray_to_clist:N and \int_array_show:N / log:N. (9d85539)
Bruno Le Floch
bruno at le-floch.fr
Fri May 4 23:58:42 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/9d855399e7a4e0283bd2166888ff809ad45802a2
>---------------------------------------------------------------
commit 9d855399e7a4e0283bd2166888ff809ad45802a2
Author: Bruno Le Floch <bruno at le-floch.fr>
Date: Fri May 4 23:58:42 2018 +0200
Implement \intarray_to_clist:N and \int_array_show:N / log:N.
>---------------------------------------------------------------
9d855399e7a4e0283bd2166888ff809ad45802a2
l3kernel/l3candidates.dtx | 78 +++++++++++++++++++++++++++
l3kernel/l3msg.dtx | 2 +
l3kernel/testfiles/m3expl001.luatex.tlg | 9 ++++
l3kernel/testfiles/m3expl001.ptex.tlg | 9 ++++
l3kernel/testfiles/m3expl001.tlg | 9 ++++
l3kernel/testfiles/m3expl001.uptex.tlg | 9 ++++
l3kernel/testfiles/m3expl001.xetex.tlg | 9 ++++
l3kernel/testfiles/m3expl003.luatex.tlg | 9 ++++
l3kernel/testfiles/m3expl003.ptex.tlg | 9 ++++
l3kernel/testfiles/m3expl003.tlg | 9 ++++
l3kernel/testfiles/m3expl003.uptex.tlg | 9 ++++
l3kernel/testfiles/m3expl003.xetex.tlg | 9 ++++
l3kernel/testfiles/m3intarray001.luatex.tlg | 31 +++++++++++
l3kernel/testfiles/m3intarray001.lvt | 15 ++++--
l3kernel/testfiles/m3intarray001.tlg | 8 +++
15 files changed, 219 insertions(+), 5 deletions(-)
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 7a5be9d..6ba99ac 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -371,6 +371,29 @@
% locally.
% \end{function}
%
+% \section{Additions to \pkg{l3intarray}}
+%
+% \subsection{Working with contents of integer arrays}
+%
+% \begin{function}[added = 2018-05-03, rEXP]{\intarray_to_clist:N}
+% \begin{syntax}
+% \cs{intarray_to_clist:N} \meta{intarray~var}
+% \end{syntax}
+% Converts the \meta{intarray} to integer denotations separated by
+% commas. All tokens have category code other. If the
+% \meta{intarray} has no entry the result is empty; otherwise the
+% result has one fewer comma than the number of items.
+% \end{function}
+%
+% \begin{function}[added = 2018-05-03]{\intarray_show:N, \intarray_log:N}
+% \begin{syntax}
+% \cs{intarray_show:N} \meta{intarray~var}
+% \cs{intarray_log:N} \meta{intarray~var}
+% \end{syntax}
+% Displays the items in the \meta{integer array variable} in the
+% terminal or writes them in the log file.
+% \end{function}
+%
% \section{Additions to \pkg{l3msg}}
%
% In very rare cases it may be necessary to produce errors in an
@@ -2119,6 +2142,61 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Additions to \pkg{l3intarray}}
+%
+% \begin{macrocode}
+%<@@=intarray>
+% \end{macrocode}
+%
+% \subsubsection{Working with contents of integer arrays}
+%
+% \begin{macro}[rEXP]{\intarray_to_clist:N, \@@_to_clist:Nn, \@@_to_clist:w}
+% Loop through the array, putting a comma before each item. Remove
+% the leading comma with |f|-expansion. We also use the auxiliary in
+% \cs{intarray_show:N} with argument comma, space.
+% \begin{macrocode}
+\cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
+\cs_new:Npn \@@_to_clist:Nn #1#2
+ {
+ \int_compare:nNnF { \intarray_count:N #1 } = \c_zero
+ {
+ \exp_last_unbraced:Nf \use_none:n
+ { \@@_to_clist:w 1 ; #1 {#2} \prg_break_point: }
+ }
+ }
+\cs_new:Npn \@@_to_clist:w #1 ; #2#3
+ {
+ \if_int_compare:w #1 > \@@_count:w #2
+ \prg_break:n
+ \fi:
+ #3 \__kernel_intarray_item:Nn #2 {#1}
+ \exp_after:wN \@@_to_clist:w
+ \int_value:w \int_eval:w #1 + \c_one ; #2 {#3}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intarray_show:N, \intarray_log:N}
+% Convert the list to a comma list (with spaces after each comma)
+% \begin{macrocode}
+\cs_new_protected:Npn \intarray_show:N { \@@_show:NN \msg_show:nnxxxx }
+\cs_generate_variant:Nn \intarray_show:N { c }
+\cs_new_protected:Npn \intarray_log:N { \@@_show:NN \msg_log:nnxxxx }
+\cs_generate_variant:Nn \intarray_log:N { c }
+\cs_new_protected:Npn \@@_show:NN #1#2
+ {
+ \__kernel_chk_defined:NT #2
+ {
+ #1 { LaTeX/kernel } { show-intarray }
+ { \token_to_str:N #2 }
+ { \intarray_count:N #2 }
+ { >~ \@@_to_clist:Nn #2 { , ~ } }
+ { }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Additions to \pkg{l3msg}}
%
% \begin{macrocode}
diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index 159f01a..6eacc18 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -1912,6 +1912,8 @@
{ is~empty \\>~ . }
{ contains~the~items~(without~outer~braces): #2 . }
}
+\__kernel_msg_new:nnn { kernel } { show-intarray }
+ { The~integer~array~#1~contains~#2~items: \\ #3 . }
\__kernel_msg_new:nnn { kernel } { show-prop }
{
The~property~list~#1~
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index fe9d7b4..27171a8 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2635,6 +2635,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5667,6 +5668,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index c7c211b..3a19505 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -2889,6 +2889,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5660,6 +5661,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 9f51fe5..355a44c 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -2889,6 +2889,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5660,6 +5661,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 6a8c640..02d8a86 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -2889,6 +2889,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5658,6 +5659,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 9c64dfb..e30e599 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2634,6 +2634,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5641,6 +5642,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index fe9d7b4..27171a8 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2635,6 +2635,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5667,6 +5668,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index c7c211b..3a19505 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -2889,6 +2889,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5660,6 +5661,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 9f51fe5..355a44c 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -2889,6 +2889,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5660,6 +5661,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 6a8c640..02d8a86 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -2889,6 +2889,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5658,6 +5659,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 9c64dfb..e30e599 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2634,6 +2634,7 @@ Defining message LaTeX/kernel/prop-keyval on line ...
Defining message LaTeX/kernel/unknown-comparison on line ...
Defining message LaTeX/kernel/zero-step on line ...
Defining message LaTeX/kernel/show-clist on line ...
+Defining message LaTeX/kernel/show-intarray on line ...
Defining message LaTeX/kernel/show-prop on line ...
Defining message LaTeX/kernel/show-seq on line ...
Defining message LaTeX/kernel/show-streams on line ...
@@ -5641,6 +5642,14 @@ Defining \file_if_exist_input:n on line ...
Defining \file_if_exist_input:nF on line ...
Defining \file_input_stop: on line ...
Defining \flag_raise_if_clear:n on line ...
+Defining \intarray_to_clist:N on line ...
+Defining \__intarray_to_clist:Nn on line ...
+Defining \__intarray_to_clist:w on line ...
+Defining \intarray_show:N on line ...
+Defining \intarray_show:c on line ...
+Defining \intarray_log:N on line ...
+Defining \intarray_log:c on line ...
+Defining \__intarray_show:NN on line ...
Defining \msg_expandable_error:nnnnnn on line ...
Defining \msg_expandable_error:nnnnn on line ...
Defining \msg_expandable_error:nnnn on line ...
diff --git a/l3kernel/testfiles/m3intarray001.luatex.tlg b/l3kernel/testfiles/m3intarray001.luatex.tlg
index 3fc351f..31c24ca 100644
--- a/l3kernel/testfiles/m3intarray001.luatex.tlg
+++ b/l3kernel/testfiles/m3intarray001.luatex.tlg
@@ -135,6 +135,23 @@ use \fontdimen immediately after the \font is loaded.
0
1234567
Defining \g_testc_intarray on line ...
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "kernel/negative-intarray-size"
+!
+! Size of intarray may not be negative: -1
+!
+! See the LaTeX3 documentation for further information.
+!
+! Type <return> to continue.
+!...............................................
+l. ... }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| LaTeX does not know anything more about this error, sorry.
+|
+| Try typing <return> to proceed.
+| If that doesn't work, type X <return> to quit.
+|...............................................
12345678
============================================================
============================================================
@@ -142,3 +159,17 @@ TEST 4: Any stray non-zero?
============================================================
Defining \g_testd_intarray on line ...
============================================================
+============================================================
+TEST 5: Zeroing
+============================================================
+0,0,24,0,0,0,0,28,0,0
+The integer array \g_testd_intarray contains 10 items:
+> 0, 0, 24, 0, 0, 0, 0, 28, 0, 0.
+24
+0,0,0,0,0,0,0,20,0,0
+The integer array \g_testd_intarray contains 10 items:
+> 0, 0, 0, 0, 0, 0, 0, 20, 0, 0.
+<recently read> }
+l. ... }
+0
+============================================================
diff --git a/l3kernel/testfiles/m3intarray001.lvt b/l3kernel/testfiles/m3intarray001.lvt
index 71fa170..da1b797 100644
--- a/l3kernel/testfiles/m3intarray001.lvt
+++ b/l3kernel/testfiles/m3intarray001.lvt
@@ -69,18 +69,23 @@
\int_gadd:Nn \g__intarray_font_int { 100000 } % to make sure nothing is suppressed accidentally by scaling the font.
\TEST { Any~stray~non-zero? }
{
- \intarray_new:Nn \g_testd_intarray { 25 }
+ \intarray_new:Nn \g_testd_intarray { 10 }
\int_step_inline:nn { \intarray_count:N \g_testd_intarray }
{ \int_compare:nNnF { \intarray_item:Nn \g_testd_intarray {#1} } = 0 { \TYPE {#1} } }
}
\TEST { Zeroing }
{
- \intarray_gset:Nnn \g_testd_intarray { 12 } { 24 }
- \intarray_gset:Nnn \g_testd_intarray { 14 } { 28 }
- \TYPE { \intarray_item:Nn \g_testd_intarray { 12 } }
+ \intarray_gset:Nnn \g_testd_intarray { 3 } { 24 }
+ \intarray_gset:Nnn \g_testd_intarray { 8 } { 28 }
+ \TYPE { \intarray_to_clist:N \g_testd_intarray }
+ \intarray_log:N \g_testd_intarray
+ \TYPE { \intarray_item:Nn \g_testd_intarray { 3 } }
\intarray_gzero:N \g_testd_intarray
- \TYPE { \intarray_item:Nn \g_testd_intarray { 12 } }
+ \intarray_gset:Nnn \g_testd_intarray { 8 } { 20 }
+ \TYPE { \intarray_to_clist:N \g_testd_intarray }
+ \intarray_show:N \g_testd_intarray
+ \TYPE { \intarray_item:Nn \g_testd_intarray { 3 } }
}
\END
diff --git a/l3kernel/testfiles/m3intarray001.tlg b/l3kernel/testfiles/m3intarray001.tlg
index 8ae8b34..6861196 100644
--- a/l3kernel/testfiles/m3intarray001.tlg
+++ b/l3kernel/testfiles/m3intarray001.tlg
@@ -172,6 +172,14 @@ Defining \g_testd_intarray on line ...
============================================================
TEST 5: Zeroing
============================================================
+0,0,24,0,0,0,0,28,0,0
+The integer array \g_testd_intarray contains 10 items:
+> 0, 0, 24, 0, 0, 0, 0, 28, 0, 0.
24
+0,0,0,0,0,0,0,20,0,0
+The integer array \g_testd_intarray contains 10 items:
+> 0, 0, 0, 0, 0, 0, 0, 20, 0, 0.
+<recently read> }
+l. ... }
0
============================================================
More information about the latex3-commits
mailing list