diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3seq.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3seq.dtx | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 088165a02fc..0babc835ec9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3names} -\GetIdInfo$Id: l3seq.dtx 2478 2011-06-19 21:34:23Z joseph $ +\GetIdInfo$Id: l3seq.dtx 2556 2011-08-12 14:00:43Z bruno $ {L3 Experimental sequences and stacks} %</driver|package> %<*driver> @@ -713,6 +713,15 @@ % \meta{comma-list}. % \end{function} % +% \begin{function}{\seq_set_reverse:N,\seq_gset_reverse:N} +% \begin{syntax} +% \cs{seq_set_reverse:N} \meta{sequence} +% \end{syntax} +% Reverses the order of items in the \meta{sequence}, and +% assigns the result to \meta{sequence}, locally or globally +% according to the variant chosen. +% \end{function} +% % \section{Internal sequence functions} % % \begin{function}{\seq_if_empty_err_break:N} @@ -823,7 +832,7 @@ % \begin{macrocode} \cs_new:Npn \seq_item:n { - \seq_use_error: + \msg_expandable_error:n { A~sequence~was~used~incorrectly. } \use_none:n } % \end{macrocode} @@ -1781,6 +1790,32 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\seq_set_reverse:N,\seq_gset_reverse:N} +% Define \cs{seq_item:n} to place its argument after a marker, +% \cs{prg_do_nothing:}. Then x-expand the sequence. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \seq_tmp:w + { \msg_expandable_error:n { There~is~a~bug~in~LaTeX3! } } +\cs_new_protected_nopar:Npn \seq_set_reverse:N + { \seq_reverse_aux:NN \tl_set:Nx } +\cs_new_protected_nopar:Npn \seq_gset_reverse:N + { \seq_reverse_aux:NN \tl_gset:Nx } +\cs_new_protected_nopar:Npn \seq_reverse_aux:NN #1 #2 + { + \cs_set_eq:NN \seq_tmp:w \seq_item:n + \cs_set_eq:NN \seq_item:n \seq_reverse_aux_item:w + #1 #2 { #2 \prg_do_nothing: } + \cs_set_eq:NN \seq_item:n \seq_tmp:w + } +\cs_new:Npn \seq_reverse_aux_item:w #1 #2 \prg_do_nothing: + { + #2 + \prg_do_nothing: + \exp_not:n { \seq_item:n {#1} } + } +% \end{macrocode} +% \end{macro} +% % \subsection{Deprecated interfaces} % % A few functions which are no longer documented: these were moved |