diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3seq.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3seq.dtx | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3seq.dtx b/Master/texmf-dist/source/latex/expl3/l3seq.dtx index 139e5038579..4c06643d19b 100644 --- a/Master/texmf-dist/source/latex/expl3/l3seq.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3seq.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3seq.dtx 1362 2009-05-28 20:19:21Z joseph $ +\GetIdInfo$Id: l3seq.dtx 1415 2009-06-17 19:37:24Z will $ {L3 Experimental sequences and stacks} %\iffalse %<*driver> @@ -301,6 +301,14 @@ % As with "\seq_show:N" but pretty prints the output one line per element. % \end{function} % +% \begin{function}{ \seq_remove_duplicates:N | +% \seq_gremove_duplicates:N } +% \begin{syntax} +% "\seq_gremove_duplicates:N" <seq> +% \end{syntax} +% Function that removes any duplicate entries in <seq>. +% \end{function} +% % \section{Predicates and conditionals} % % \begin{function}{ \seq_if_empty_p:N / (EXP) | @@ -865,6 +873,45 @@ % \end{macro} % \end{macro} % +% \subsection{Manipulation} +% +% \begin{macro}[aux]{\l_clist_remove_clist} +% A common scratch space for the removal routines. +% \begin{macrocode} +\seq_new:N \l_seq_remove_seq +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[aux]{\seq_remove_duplicates_aux:NN} +% \begin{macro}[aux]{\seq_remove_duplicates_aux:n} +% \begin{macro}{\seq_remove_duplicates:N} +% \begin{macro}{\seq_gremove_duplicates:N} +% Copied from "\clist_remove_duplicates". +% \begin{macrocode} +\cs_new:Nn \seq_remove_duplicates_aux:NN { + \seq_clear:N \l_seq_remove_seq + \seq_map_function:NN #2 \seq_remove_duplicates_aux:n + #1 #2 \l_seq_remove_seq +} +\cs_new:Nn \seq_remove_duplicates_aux:n { + \seq_if_in:NnF \l_seq_remove_seq {#1} { + \seq_put_right:Nn \l_seq_remove_seq {#1} + } +} +% \end{macrocode} +% \begin{macrocode} +\cs_new_nopar:Npn \seq_remove_duplicates:N { + \seq_remove_duplicates_aux:NN \seq_set_eq:NN +} +\cs_new_nopar:Npn \seq_gremove_duplicates:N { + \seq_remove_duplicates_aux:NN \seq_gset_eq:NN +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Sequence stacks} % % \begin{macro}{\seq_push:Nn} |