[latex3-commits] [git/LaTeX3-latex3-latex3] luaintarray: Update some comments (0235861f2)

Marcel Fabian Krüger tex at 2krueger.de
Sun Nov 14 16:31:32 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : luaintarray
Link       : https://github.com/latex3/latex3/commit/0235861f2ddc34896095db160ca99187b8b94bb2

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

commit 0235861f2ddc34896095db160ca99187b8b94bb2
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sun Nov 14 16:31:32 2021 +0100

    Update some comments


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

0235861f2ddc34896095db160ca99187b8b94bb2
 l3kernel/l3intarray.dtx | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/l3kernel/l3intarray.dtx b/l3kernel/l3intarray.dtx
index b824a4898..0c57d655c 100644
--- a/l3kernel/l3intarray.dtx
+++ b/l3kernel/l3intarray.dtx
@@ -192,7 +192,6 @@
 %    \begin{macrocode}
 \cs_if_exist:NTF \@@_gset_count:Nw
 {
-%</tex>
 %    \end{macrocode}
 %
 % \subsubsection{Allocating arrays}
@@ -200,7 +199,6 @@
 % \begin{variable}{\l_@@_loop_int}
 %   A loop index.
 %    \begin{macrocode}
-%<*tex>
 \int_new:N \l_@@_loop_int
 %    \end{macrocode}
 % \end{variable}
@@ -479,10 +477,8 @@ end, 'global')
 % \subsubsection{Working with contents of integer arrays}
 %
 % \begin{macro}{\intarray_const_from_clist:Nn, \intarray_const_from_clist:cn}
-%   The current Lua helpers do not allow to avoid bound checking, so we have
-%   to count the elements first. Otherwise it is basically the same as
-%   \cs{intarray_new:Nn} (which we don't use because it would complain about the
-%   wrong qualifier in debugging mode)
+%   We use the \cs{__kernel_intarray_gset:Nnn} which does not do bounds checking
+%   and instead automatically resizes the array.
 %   This is not implemented in Lua to ensure that the clist parsing is consistent
 %   with the clist module.
 %    \begin{macrocode}
@@ -501,9 +497,12 @@ end, 'global')
 %
 % \begin{macro}[rEXP]{\intarray_to_clist:N, \intarray_to_clist:c}
 % \begin{macro}[rEXP]{\@@_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.
+%   The \cs{@@_to_clist:Nn} auxiliary allows to choose the delimiter and
+%   is also used in \cs{intarray_show:N}. Here we just pass the information
+%   to Lua and let \texttt{table.concat} do the actual work.
+%   We discard the category codes of the passed delimiter but this is not
+%   an issue since the delimiter is always just a comma or a comma and a space.
+%   In both cases \texttt{sprint(2, ...)} provides the right catcodes.
 %    \begin{macrocode}
 \cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
 \cs_generate_variant:Nn \intarray_to_clist:N { c }





More information about the latex3-commits mailing list.