Skip to content

Commit

Permalink
Add e-type variants for expandable clist funcs (see #1257)
Browse files Browse the repository at this point in the history
These come up a few times and seem reasonable
enough.
  • Loading branch information
josephwright committed Sep 8, 2023
1 parent 37af1c8 commit 3720fac
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions l3kernel/l3clist.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
% \texttt{n}-type comma lists.
%
% \begin{function}[rEXP, updated = 2012-06-29]
% {\clist_map_function:NN, \clist_map_function:cN, \clist_map_function:nN}
% {\clist_map_function:NN, \clist_map_function:cN, \clist_map_function:nN, \clist_map_function:eN}
% \begin{syntax}
% \cs{clist_map_function:NN} \meta{clist~var} \meta{function}
% \end{syntax}
Expand Down Expand Up @@ -548,7 +548,7 @@
% \end{function}
%
% \begin{function}[EXP, added = 2012-07-13]
% {\clist_count:N, \clist_count:c, \clist_count:n}
% {\clist_count:N, \clist_count:c, \clist_count:n, \clist_count:e}
% \begin{syntax}
% \cs{clist_count:N} \meta{clist~var}
% \end{syntax}
Expand Down Expand Up @@ -722,7 +722,7 @@
% \section{Using a single item}
%
% \begin{function}[added = 2014-07-17, EXP]
% {\clist_item:Nn, \clist_item:cn, \clist_item:nn}
% {\clist_item:Nn, \clist_item:cn, \clist_item:nn, \clist_item:en}
% \begin{syntax}
% \cs{clist_item:Nn} \meta{clist~var} \Arg{int expr}
% \end{syntax}
Expand Down Expand Up @@ -1726,7 +1726,7 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}{\clist_map_function:nN}
% \begin{macro}{\clist_map_function:nN, \clist_map_function:eN}
% \UnitTested
% \begin{macro}{\@@_map_function_n:Nn}
% \begin{macro}{\@@_map_unbrace:wn}
Expand All @@ -1745,6 +1745,7 @@
\s_@@_stop \clist_map_break: ,
\prg_break_point:Nn \clist_map_break: { }
}
\cs_generate_variant:Nn \clist_map_function:nN { e }
\cs_new:Npn \@@_map_function_n:Nn #1 #2
{
\@@_use_none_delimit_by_s_stop:w #2 \s_@@_stop
Expand Down Expand Up @@ -1893,7 +1894,7 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\clist_count:N, \clist_count:c, \clist_count:n}
% \begin{macro}{\clist_count:N, \clist_count:c, \clist_count:n, \clist_count:e}
% \begin{macro}{\@@_count:n}
% \begin{macro}{\@@_count:w}
% Counting the items in a comma list is done using the same approach as for
Expand Down Expand Up @@ -1933,6 +1934,7 @@
}
}
\exp_args:No \@@_tmp:w \c_space_tl
\cs_generate_variant:Nn \clist_count:n { e }
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand Down Expand Up @@ -2110,7 +2112,7 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}{\clist_item:nn}
% \begin{macro}{\clist_item:nn, \clist_item:en}
% \begin{macro}{
% \@@_item_n:nw,
% \@@_item_n_loop:nw,
Expand All @@ -2130,6 +2132,7 @@
{#1}
\@@_item_n:nw
}
\cs_generate_variant:Nn \clist_item:nn { e }
\cs_new:Npn \@@_item_n:nw #1
{ \@@_item_n_loop:nw {#1} \prg_do_nothing: }
\cs_new:Npn \@@_item_n_loop:nw #1 #2,
Expand Down

0 comments on commit 3720fac

Please sign in to comment.