summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3intarray.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-06 03:01:13 +0000
committerNorbert Preining <norbert@preining.info>2023-05-06 03:01:13 +0000
commit507fa9c669d7e4bc2c808f269113c6ced0b18827 (patch)
tree92d0ad38dc9549526803851fa62b4399f03006ac /macros/latex/contrib/l3kernel/l3intarray.dtx
parent3cf2e76fc502cb474081c80838c95ecaba2f386d (diff)
CTAN sync 202305060301
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3intarray.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3intarray.dtx106
1 files changed, 1 insertions, 105 deletions
diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx
index bc521e41f2..d2af694015 100644
--- a/macros/latex/contrib/l3kernel/l3intarray.dtx
+++ b/macros/latex/contrib/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2023-04-20}
+% \date{Released 2023-05-05}
%
% \maketitle
%
@@ -495,7 +495,6 @@ end, 'global')
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[rEXP]{\intarray_to_clist:N, \intarray_to_clist:c}
% \begin{macro}[rEXP]{\@@_to_clist:Nn, \@@_to_clist:w}
% 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
@@ -504,8 +503,6 @@ end, 'global')
% 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 }
%</tex>
%<*lua>
local concat = table.concat
@@ -517,7 +514,6 @@ end, 'global')
%</lua>
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[rEXP]{\__kernel_intarray_range_to_clist:Nnn, \@@_range_to_clist:w}
% Loop through part of the array.
@@ -840,14 +836,11 @@ luacmd('@@_gset_range:w', function()
% \end{macro}
% \end{macro}
%
-% \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.
% \begin{macrocode}
- \cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
- \cs_generate_variant:Nn \intarray_to_clist:N { c }
\cs_new:Npn \@@_to_clist:Nn #1#2
{
\int_compare:nNnF { \intarray_count:N #1 } = \c_zero_int
@@ -867,7 +860,6 @@ luacmd('@@_gset_range:w', function()
}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[rEXP]{\__kernel_intarray_range_to_clist:Nnn, \@@_range_to_clist:ww}
% Loop through part of the array.
@@ -941,102 +933,6 @@ luacmd('@@_gset_range:w', function()
% \end{macrocode}
% \end{macro}
%
-% \subsubsection{Random arrays}
-%
-% \begin{macro}{\intarray_gset_rand:Nn, \intarray_gset_rand:cn}
-% \begin{macro}{\intarray_gset_rand:Nnn, \intarray_gset_rand:cnn}
-% \begin{macro}
-% {
-% \@@_gset_rand:Nnn,
-% \@@_gset_rand:Nff,
-% \@@_gset_rand_auxi:Nnnn,
-% \@@_gset_rand_auxii:Nnnn,
-% \@@_gset_rand_auxiii:Nnnn,
-% \@@_gset_all_same:Nn,
-% }
-% We only perform the bounds checks once. This is done by two
-% \cs{@@_gset_overflow_test:nw}, with an appropriate empty argument to
-% avoid a spurious \enquote{at position \texttt{\#1}} part in the
-% error message. Then calculate the number of choices: this is at
-% most $(2^{30}-1)-(-(2^{30}-1))+1=2^{31}-1$, which just barely does
-% not overflow. For small ranges use \cs{__kernel_randint:n} (making
-% sure to subtract~$1$ \emph{before} adding the random number to the
-% \meta{min}, to avoid overflow when \meta{min} or \meta{max} are
-% $\pm\cs{c_max_int}$), otherwise \cs{__kernel_randint:nn}. Finally,
-% if there are no random numbers do not define any of the auxiliaries.
-% \begin{macrocode}
-\cs_new_protected:Npn \intarray_gset_rand:Nn #1
- { \intarray_gset_rand:Nnn #1 { 1 } }
-\cs_generate_variant:Nn \intarray_gset_rand:Nn { c }
-\sys_if_rand_exist:TF
- {
- \cs_new_protected:Npn \intarray_gset_rand:Nnn #1#2#3
- {
- \@@_gset_rand:Nff #1
- { \int_eval:n {#2} } { \int_eval:n {#3} }
- }
- \cs_new_protected:Npn \@@_gset_rand:Nnn #1#2#3
- {
- \int_compare:nNnTF {#2} > {#3}
- {
- \msg_expandable_error:nnnn
- { kernel } { randint-backward-range } {#2} {#3}
- \@@_gset_rand:Nnn #1 {#3} {#2}
- }
- {
- \@@_gset_overflow_test:nw {#2}
- \@@_gset_rand_auxi:Nnnn #1 { } {#2} {#3}
- }
- }
- \cs_generate_variant:Nn \@@_gset_rand:Nnn { Nff }
- \cs_new_protected:Npn \@@_gset_rand_auxi:Nnnn #1#2#3#4
- {
- \@@_gset_overflow_test:nw {#4}
- \@@_gset_rand_auxii:Nnnn #1 { } {#4} {#3}
- }
- \cs_new_protected:Npn \@@_gset_rand_auxii:Nnnn #1#2#3#4
- {
- \exp_args:NNf \@@_gset_rand_auxiii:Nnnn #1
- { \int_eval:n { #3 - #4 + 1 } } {#4} {#3}
- }
- \cs_new_protected:Npn \@@_gset_rand_auxiii:Nnnn #1#2#3#4
- {
- \exp_args:NNf \@@_gset_all_same:Nn #1
- {
- \int_compare:nNnTF {#2} > \c__kernel_randint_max_int
- {
- \exp_stop_f:
- \int_eval:n { \__kernel_randint:nn {#3} {#4} }
- }
- {
- \exp_stop_f:
- \int_eval:n { \__kernel_randint:n {#2} - 1 + #3 }
- }
- }
- }
- \cs_new_protected:Npn \@@_gset_all_same:Nn #1#2
- {
- \int_zero:N \l_@@_loop_int
- \prg_replicate:nn { \intarray_count:N #1 }
- {
- \int_incr:N \l_@@_loop_int
- \__kernel_intarray_gset:Nnn #1 \l_@@_loop_int {#2}
- }
- }
- }
- {
- \cs_new_protected:Npn \intarray_gset_rand:Nnn #1#2#3
- {
- \msg_error:nnn { kernel } { fp-no-random }
- { \intarray_gset_rand:Nnn #1 {#2} {#3} }
- }
- }
-\cs_generate_variant:Nn \intarray_gset_rand:Nnn { c }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
% \begin{macrocode}
%</tex>
%</package>