summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/expl3/l3seq.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3seq.dtx')
-rw-r--r--Master/texmf-dist/source/latex/expl3/l3seq.dtx412
1 files changed, 317 insertions, 95 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3seq.dtx b/Master/texmf-dist/source/latex/expl3/l3seq.dtx
index f3da69642ef..dff922a84d2 100644
--- a/Master/texmf-dist/source/latex/expl3/l3seq.dtx
+++ b/Master/texmf-dist/source/latex/expl3/l3seq.dtx
@@ -1,15 +1,51 @@
% \iffalse
-%% File: l3seq.dtx Copyright (C) 1990-1998 LaTeX3 project
-%
+%% File: l3seq.dtx Copyright (C) 1990-2006 LaTeX3 project
+%%
+%% It may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this
+%% license or (at your option) any later version. The latest version
+%% of this license is in the file
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This file is part of the ``expl3 bundle'' (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%
+%<package>\RequirePackage{l3names}
%<*dtx>
- \ProvidesFile{l3seq.dtx}
+%\fi
+\def\GetIdInfo$Id: #1.dtx #2 #3-#4-#5 #6 #7$#8{%
+ \def\fileversion{#2}%
+ \def\filedate{#3/#4/#5}%
+ \ProvidesFile{#1.dtx}[#3/#4/#5 v#2 #8]%
+}
+%\iffalse
%</dtx>
-%<package>\NeedsTeXFormat{LaTeX2e}
-%<package>\ProvidesPackage{l3seq}
-%<driver> \ProvidesFile{l3seq.drv}
-% \fi
-% \ProvidesFile{l3seq.dtx}
- [1998/04/20 v1.0d L3 Experimental Token List Pointers]
+%\fi
+\GetIdInfo$Id: l3seq.dtx 573 2006-08-21 20:59:37Z morten $
+ {L3 Experimental sequences and stacks}
+%
%
% \iffalse
%<*driver>
@@ -22,7 +58,6 @@
% \fi
%
%
-% \GetFileInfo{l3seq.dtx}
% \title{The \textsf{l3seq} package\thanks{This file
% has version number \fileversion, last
% revised \filedate.}\\
@@ -33,8 +68,8 @@
%
%
%
-% \section{Sequence}
-%
+% \section{Sequences}
+%
% \LaTeX3 implements a data type called `sequences'. These are special
% token lists that can be accessed via special function on the `left'.
% Appending tokens is possible at both ends. Appended token lists can be
@@ -43,26 +78,25 @@
% functions that are used to structure sequences (see section internal
% functions below). It is also possible to map functions on such
% sequences so that they are executed for every item on the sequence.
-%
-% All functions that return items from a sequence in some <tlp> assume
-% that the <tlp> is local. See remarks below if you need a global
+%
+% All functions that return items from a sequence in some \m{tlp} assume
+% that the \m{tlp} is local. See remarks below if you need a global
% returned value.
-%
+%
% The defined functions are not orthogonal in the sense that every
% possible variation possible is actually available. If you need a new
% variant use the expansion functions described in the package
% \texttt{l3expan} to build it.
-%
+%
% Adding items to the left of a sequence can currently be done with
% either something like "\seq_put_left:Nn" or with a ``stack'' function
% like "\seq_push:Nn" which has the same effect. Maybe one should
% therefore remove the ``left'' functions totally.
-%
+%
% \subsection{Functions}
-%
+%
% \begin{function}{%
% \seq_new:N |
-% \seq_new:O |
% \seq_new:c |
% }
% \begin{syntax}
@@ -70,7 +104,7 @@
% \end{syntax}
% Defines <sequence> to be a variable of type sequences.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_clear:N |
% \seq_clear:c |
@@ -82,7 +116,7 @@
% \end{syntax}
% These functions locally or globally clear <sequence>.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_put_left:Nn |
% \seq_put_left:No |
@@ -99,10 +133,11 @@
% or right of <sequence>. <token list> might get expanded before
% appending.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_gput_left:Nn |
% \seq_gput_right:Nn |
+% \seq_gput_right:Nc |
% \seq_gput_right:No |
% \seq_gput_right:cn |
% \seq_gput_right:co |
@@ -114,7 +149,7 @@
% Globally appends <token list> as a single item to the left
% or right of <sequence>.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_get:NN |
% \seq_get:cN |
@@ -132,7 +167,30 @@
% But if this kind of construction is used often enough a separate
% function should be provided.
% \end{function}
-%
+%
+% \begin{function}{%
+% \seq_set_eq:NN
+% }
+% \begin{syntax}
+% "\seq_set_eq:NN" <seq1> <seq2>
+% \end{syntax}
+% Function that locally makes <seq1> identical to <seq2>.
+% \end{function}
+%
+%
+%
+% \begin{function}{%
+% \seq_gset_eq:NN |
+% \seq_gset_eq:cN |
+% \seq_gset_eq:Nc |
+% \seq_gset_eq:cc
+% }
+% \begin{syntax}
+% "\seq_gset_eq:NN" <seq1> <seq2>
+% \end{syntax}
+% Function that globally makes <seq1> identical to <seq2>.
+% \end{function}
+%
% \begin{function}{%
% \seq_gconcat:NNN |
% \seq_gconcat:ccc |
@@ -143,7 +201,19 @@
% Function that conatenates <seq2> and <seq3> and globally assigns the
% result to <seq1>.
% \end{function}
-%
+%
+% \begin{function}{\seq_map_variable:NNn |
+% \seq_map_variable:cNn
+% }
+% \begin{syntax}
+% "\seq_map_variable:NNn" <sequence> <tlp> "{" <code using tlp> "}"
+% \end{syntax}
+% Every element in <sequence> is assigned to <tlp> and then <code
+% using tlp> is executed. The operation is not expandable which means
+% that it can't be used within write operations etc. However, this
+% function can be nested which the others can't.
+% \end{function}
+%
% \begin{function}{\seq_map:NN}
% \begin{syntax}
% "\seq_map:NN" <sequences> <function>
@@ -153,11 +223,11 @@
% within a sub-group so that side effects can be achieved locally. The
% operation is not expandable which means that it can't be used within
% write operations etc.
-%
+%
% In the current implementation the next functions are more efficient and
% should be preferred.
% \end{function}
-%
+%
% \begin{function}{\seq_map_inline:Nn |
% \seq_map_inline:cn
% }
@@ -171,34 +241,37 @@
% The operation is not expandable which means that it can't be used
% within write operations etc.
% \end{function}
-%
+%
% \subsection{Predicates and conditionals}
-%
-% \begin{function}{\seq_empty_p:N}
+%
+% \begin{function}{\seq_if_empty_p:N}
% \begin{syntax}
-% "\seq_empty_p:N" <sequence>
+% "\seq_if_empty_p:N" <sequence>
% \end{syntax}
% This predicate returns `true' if <sequence> is `empty' i.e., doesn't
% contain any tokens.
% \end{function}
-%
+%
% \begin{function}{%
-% \seq_empty:NTF |
-% \seq_empty:cTF |
-% \seq_empty:NF |
-% \seq_empty:cF |
+% \seq_if_empty:NTF |
+% \seq_if_empty:cTF |
+% \seq_if_empty:NF |
+% \seq_if_empty:cF |
% }
% \begin{syntax}
-% "\seq_empty:NTF" <sequence> "{" <true code> "}{" <false code> "}"
+% "\seq_if_empty:NTF" <sequence> "{" <true code> "}{" <false code> "}"
% \end{syntax}
% Set of conditionals that test whether or not a particular <sequence>
% is empty and if so executes either <true code> or <false code>.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_if_in:NnTF |
% \seq_if_in:cnTF |
% \seq_if_in:coTF |
+% \seq_if_in:cxTF |
+% \seq_if_in:NnF |
+% \seq_if_in:cnF |
% }
% \begin{syntax}
% "\seq_if_in:NnTF" <sequ> "{" <item> "}{" <true code> "}{" <false code> "}"
@@ -206,16 +279,16 @@
% Function that tests if <item> is in <sequ>. Depending on the result
% either <true code> or <false code> is executed.
% \end{function}
-%
+%
% \subsection{Internal functions}
-%
-% \begin{function}{\seq_empty_err:N}
+%
+% \begin{function}{\seq_if_empty_err:N}
% \begin{syntax}
-% "\seq_empty_err:N" <sequence>
+% "\seq_if_empty_err:N" <sequence>
% \end{syntax}
% Signals an \LaTeX3 error if <sequence> is empty.
% \end{function}
-%
+%
% \begin{function}{\seq_pop_aux:nnNN}
% \begin{syntax}
% "\seq_pop_aux:nnNN" <assign1> <assign2> <sequence> <tlp>
@@ -224,7 +297,7 @@
% <assign1> and assigns the tail to <sequence> using <assign2>. This
% function could be used to implement a global return function.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_get_aux:w |
% \seq_pop_aux:w |
@@ -234,7 +307,7 @@
% Functions used to implement put and get operations. They are not for
% meant for direct use.
% \end{function}
-%
+%
% \begin{function}{%
% \seq_elt:w |
% \seq_elt_end: }
@@ -243,19 +316,71 @@
% are not supposed to show up as tokens within an item appended to a
% sequence.
% \end{function}
-%
%
-% \section {Implementation}
+% \section{Sequence Stacks}
+%
+% Special sequences in \LaTeX3 are `stacks' with their usual operations
+% of`push', `pop', and `top'. They are internally implemented as
+% sequences and share some of the functions (like "\seq_new:N" etc.)
+%
+% \subsection{Functions}
+%
+% \begin{function}{%
+% \seq_push:Nn |
+% \seq_push:No |
+% \seq_push:cn |
+% \seq_gpush:Nn |
+% \seq_gpush:No |
+% \seq_gpush:cn |
+% }
+% \begin{syntax}
+% "\seq_push:Nn" <stack> "{" <token list> "}"
+% \end{syntax}
+% Locally or globally pushes <token list> as a single item onto the
+% <stack>. <token list> might get expanded before the operation.
+% \end{function}
+%
+% \begin{function}{%
+% \seq_pop:NN |
+% \seq_pop:cN |
+% \seq_gpop:NN |
+% \seq_gpop:cN |
+% }
+% \begin{syntax}
+% "\seq_pop:NN" <stack> <tlp>
+% \end{syntax}
+% Functions that assign the top item of <stack> to the token
+% list pointer <tlp> and removes it from <stack>!
+% \end{function}
+%
+% \begin{function}{%
+% \seq_top:NN |
+% \seq_top:cN |
+% }
+% \begin{syntax}
+% "\seq_top:NN" <stack> <tlp>
+% \end{syntax}
+% Functions that locally assign the top item of <stack> to the token
+% list pointer <tlp>. Item is not removed from <stack>!
+% \end{function}
+%
+% \subsection{Predicates and conditionals}
+%
+% Use "seq" functions.
+%
+% \StopEventually{}
+%
+% \subsection {Implementation}
+%
%
% We start by ensuring that the required packages are loaded.
% \begin{macrocode}
-%<package&!check>\RequirePackage{l3toks}
%<package&!check>\RequirePackage{l3quark}
+%<package&!check>\RequirePackage{l3tlp}
%<package&check>\RequirePackage{l3chk}
%<package>\RequirePackage{l3expan}
-%<*package>
% \end{macrocode}
-%
+%
% A sequence is a control sequence whose top-level expansion is of the
% form `|\seq_elt:w| \m{text$\sb1$} |\seq_elt_end:| \ldots{}
% |\seq_elt:w| \zv{text$\sb{n}$} \ldots'. We use explicit delimiters
@@ -264,27 +389,25 @@
%
% \begin{macro}{\seq_elt:w}
% \begin{macro}{\seq_elt_end:}
-% We allocate the delimiters and make them noops as default.
+% We allocate the delimiters and make them errors if executed.
% \begin{macrocode}
-\let_new:NN \seq_elt:w \use_noop:
-\let_new:NN \seq_elt_end: \use_noop:
+%<*initex|package>
+\let_new:NN \seq_elt:w \ERROR
+\let_new:NN \seq_elt_end: \ERROR
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\seq_new:N}
-% \begin{macro}{\seq_new:O}
% \begin{macro}{\seq_new:c}
% Sequences are implemented using token lists.
% \begin{macrocode}
\def_new:Npn \seq_new:N #1{\tlp_new:Nn #1{}}
\def_new:Npn \seq_new:c {\exp_args:Nc \seq_new:N}
-\def_new:Npn \seq_new:O {\exp_args:No \seq_new:N}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{\seq_clear:N}
% \begin{macro}{\seq_clear:c}
@@ -318,35 +441,30 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\seq_empty_p:N}
+% \begin{macro}{\seq_if_empty_p:N}
% A predicate which evaluates to |\c_true| iff the sequence is empty.
% \begin{macrocode}
-\let_new:NN \seq_empty_p:N \tlp_empty_p:N
+\let_new:NN \seq_if_empty_p:N \tlp_if_empty_p:N
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\seq_empty:NTF}
-% \begin{macro}{\seq_empty:cTF}
-% \begin{macro}{\seq_empty:NF}
-% \begin{macro}{\seq_empty:cF}
-% |\seq_empty:NTF|\m{seq}\m{true~case}\m{false~case} will check
+% \begin{macro}{\seq_if_empty:NTF}
+% \begin{macro}{\seq_if_empty:cTF}
+% \begin{macro}{\seq_if_empty:NF}
+% \begin{macro}{\seq_if_empty:cF}
+% |\seq_if_empty:NTF|\m{seq}\m{true~case}\m{false~case} will check
% whether the \m{seq} is empty and then select one of the other
-% arguments. |seq_empty:cTF| turns its first argument into a
+% arguments. |seq_if_empty:cTF| turns its first argument into a
% control sequence to get the name of the sequence.
% \begin{macrocode}
-\def_new:Npn \seq_empty:NTF #1{
- \if_meaning:NN#1\c_empty_tlp
- \exp_after:NN\use_choice_i:nn
- \else: \exp_after:NN\use_choice_ii:nn \fi:}
-\def_new:Npn \seq_empty:cTF {\exp_args:Nc\seq_empty:NTF}
+\let_new:NN \seq_if_empty:NTF \tlp_if_empty:NTF
+\def_new:Npn \seq_if_empty:cTF {\exp_args:Nc\seq_if_empty:NTF}
% \end{macrocode}
% A variant of this, is only to do something if the sequence is
-% {\em not} empty.
+% \emph{not} empty.
% \begin{macrocode}
-\def_new:Npn \seq_empty:NF #1{
- \if_meaning:NN#1\c_empty_tlp \exp_after:NN\use_none:n
- \else: \exp_after:NN\use:n \fi:}
-\def_new:Npn \seq_empty:cF {\exp_args:Nc\seq_empty:NF}
+\let_new:NN \seq_if_empty:NF \tlp_if_empty:NF
+\def_new:Npn \seq_if_empty:cF {\exp_args:Nc\seq_if_empty:NF}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -354,10 +472,10 @@
% \end{macro}
%
%
-% \begin{macro}{\seq_empty_err:N}
+% \begin{macro}{\seq_if_empty_err:N}
% Signals an error if the sequence is empty.
% \begin{macrocode}
-\def_new:Npn \seq_empty_err:N #1{\if_meaning:NN#1\c_empty_tlp
+\def_new:Npn \seq_if_empty_err:N #1{\if_meaning:NN#1\c_empty_tlp
% \end{macrocode}
% As I said before, I don't think we need to provide checks for this
% kind of error, since it is a severe internal macro package error
@@ -365,7 +483,7 @@
% next line of code should be probably removed.
% \begin{macrocode}
\tlp_clear:N \l_testa_tlp % catch prefixes
- \err_latex_bug:n{Empty~sequence~`\token_to_string:N#1'}\fi:}
+ \err_latex_bug:x{Empty~sequence~`\token_to_string:N#1'}\fi:}
% \end{macrocode}
% \end{macro}
%
@@ -375,7 +493,7 @@
% left_most element of \zz{sequence}.
% \begin{macrocode}
\def_new:Npn \seq_get:NN #1{
- \seq_empty_err:N #1
+ \seq_if_empty_err:N #1
\exp_after:NN\seq_get_aux:w #1\q_stop}
\def_new:Npn \seq_get_aux:w \seq_elt:w #1\seq_elt_end:
#2\q_stop #3{\tlp_set:Nn #3{#1}}
@@ -385,18 +503,20 @@
% \end{macro}
%
% \begin{macro}{\seq_pop_aux:nnNN}
+% \begin{macro}{\seq_pop_aux:w}
% |\seq_pop_aux:nnNN| \zz{def$\sb1$} \zz{def$\sb2$} \zz{sequence}
% \zz{cmd} assigns the left_most element of \zz{sequence} to
% \zz{cmd} using \zz{def$\sb2$}, and assigns the tail of
% \zz{sequence} to \zz{sequence} using \zz{def$\sb1$}.
% \begin{macrocode}
\def_new:Npn \seq_pop_aux:nnNN #1#2#3{
- \seq_empty_err:N #3
+ \seq_if_empty_err:N #3
\exp_after:NN\seq_pop_aux:w #3\q_stop #1#2#3}
\def_new:Npn \seq_pop_aux:w \seq_elt:w #1\seq_elt_end:
#2\q_stop #3#4#5#6{#3#5{#2}#4#6{#1}}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\seq_put_aux:Nnn}
% |\seq_put_aux:Nnn| \zz{sequence} \zv{left} \zv{right} adds the
@@ -430,8 +550,8 @@
\def_new:Npn \seq_put_left:Nx {\exp_args:Nnx\seq_put_left:Nn}
\def_new:Npn \seq_put_right:Nn #1#2{
\seq_put_aux:Nnn #1{}{\seq_elt:w #2\seq_elt_end:}}
-\def_new:Npn \seq_put_right:No {\exp_args:Nno\seq_put_right:Nn}
-\def_new:Npn \seq_put_right:Nx {\exp_args:Nnx\seq_put_right:Nn}
+\def_new:Npn \seq_put_right:No {\exp_args:NNo\seq_put_right:Nn}
+\def_new:Npn \seq_put_right:Nx {\exp_args:NNx\seq_put_right:Nn}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -443,6 +563,7 @@
%
% \begin{macro}{\seq_gput_left:Nn}
% \begin{macro}{\seq_gput_right:Nn}
+% \begin{macro}{\seq_gput_right:Nc}
% \begin{macro}{\seq_gput_right:No}
% \begin{macro}{\seq_gput_right:cn}
% \begin{macro}{\seq_gput_right:co}
@@ -453,15 +574,16 @@
%<*check>
\pref_global_chk:
%</check>
-%<_check> \pref_global:D
+%<-check> \pref_global:D
\seq_put_left:Nn}
\def_new:Npn \seq_gput_right:Nn {
%<*check>
\pref_global_chk:
%</check>
-%<_check> \pref_global:D
+%<-check> \pref_global:D
\seq_put_right:Nn}
\def_new:Npn \seq_gput_right:No {\exp_args:NNo \seq_gput_right:Nn}
+\def_new:Npn \seq_gput_right:Nc {\exp_args:NNc \seq_gput_right:Nn}
\def_new:Npn \seq_gput_right:cn {\exp_args:Nc \seq_gput_right:Nn}
\def_new:Npn \seq_gput_right:co {\exp_args:Nco \seq_gput_right:Nn}
\def_new:Npn \seq_gput_right:cc {\exp_args:Ncc \seq_gput_right:Nn}
@@ -472,6 +594,33 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\seq_map_variable:NNn}
+% \begin{macro}{\seq_map_variable:cNn}
+% \begin{macro}{\seq_map_variable_aux:nw}
+% \begin{macro}{\seq_map_break:w}
+% Nothing spectacular here. The shuffling of the arguments in
+% |\seq_map_variable:NNn| below could also be done with
+% |\exp_args:NNnE|.
+% \begin{macrocode}
+\def_new:Npn \seq_map_variable_aux:Nnw #1#2\seq_elt:w#3\seq_elt_end:{
+ \tlp_set:Nn #1{#3}
+ \quark_if_nil:NT #1 \seq_map_break:w
+ #2
+ \seq_map_variable_aux:Nnw #1{#2}
+}
+\def_new:Npn \seq_map_variable:NNn #1#2#3{
+ \tlp_set:Nx #2 {\exp_not:n{\seq_map_variable_aux:Nnw #2{#3}}}
+ \exp_after:NN #2 #1 \seq_elt:w \q_nil\seq_elt_end: \q_stop
+}
+\def_new:Npn \seq_map_variable:cNn{\exp_args:Nc\seq_map_variable:Nn}
+\let_new:NN \seq_map_break:w \use_none_delimit_by_q_stop:w
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\seq_map:NN}
% |\seq_map:NN| \zz{sequence} \zz{cmd} applies \zz{cmd} to each
@@ -481,7 +630,9 @@
% that is delimited by |\seq_elt_end:|.
% \begin{macrocode}
\def_new:Npn \seq_map:NN #1#2{
- \def:Npn \seq_elt:w ##1\seq_elt_end: {#2{##1}}#1}
+ \def:Npn \seq_elt:w ##1\seq_elt_end: {#2{##1}}#1
+ \let:NN \seq_elt:w \ERROR
+}
% \end{macrocode}
% \end{macro}
%
@@ -491,21 +642,51 @@
% natural.
% \begin{macrocode}
\def_new:Npn \seq_map_inline:Nn #1#2{
- \gdef:Npn \seq_elt:w ##1\seq_elt_end: {#2}#1}
+ \def:Npn \seq_elt:w ##1\seq_elt_end: {#2}#1
+ \let:NN \seq_elt:w \ERROR
+}
\def_new:Npn \seq_map_inline:cn{\exp_args:Nc\seq_map_inline:Nn}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\seq_set_eq:NN}
+% \begin{macro}{\seq_set_eq:Nc}
+% We can set one seq equal to another.
+% \begin{macrocode}
+\let_new:NN \seq_set_eq:NN \let:NN
+\def_new:Npn \seq_set_eq:Nc {\exp_args:NNc \seq_set_eq:NN}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\seq_gset_eq:NN}
+% \begin{macro}{\seq_gset_eq:cN}
+% \begin{macro}{\seq_gset_eq:Nc}
+% \begin{macro}{\seq_gset_eq:cc}
+% An of course globally which seems to be needed far more
+% often.\footnote{To save a bit of space these functions could be made
+% identical to those from the tlp or clist module.}
+% \begin{macrocode}
+\let_new:NN \seq_gset_eq:NN \glet:NN
+\def_new:Npn \seq_gset_eq:cN {\exp_args:Nc \seq_gset_eq:NN}
+\def_new:Npn \seq_gset_eq:Nc {\exp_args:NNc \seq_gset_eq:NN}
+\def_new:Npn \seq_gset_eq:cc {\exp_args:Ncc \seq_gset_eq:NN}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\seq_gconcat:NNN}
% \begin{macro}{\seq_gconcat:ccc}
% |\seq_gconcat:NNN| \m{seq~1} \m{seq~2} \m{seq~3} will globally
% assign \m{seq~1} the concatenation of \m{seq~2} and \m{seq~3}.
% \begin{macrocode}
\def_new:Npn \seq_gconcat:NNN #1#2#3{
- \l_tmpa_toks \exp_after:NN{#2}
- \l_tmpb_toks \exp_after:NN{#3}
- \gdef:Npx #1{\toks_use:N \l_tmpa_toks \toks_use:N \l_tmpb_toks}}
+ \tlp_gset:Nx #1 {\exp_not:o{#2}\exp_not:o{#3}}
+}
\def_new:Npn \seq_gconcat:ccc{\exp_args:Nccc\seq_gconcat:NNN}
% \end{macrocode}
% \end{macro}
@@ -514,10 +695,13 @@
% \begin{macro}{\seq_if_in:NnTF}
% \begin{macro}{\seq_if_in:cnTF}
% \begin{macro}{\seq_if_in:coTF}
+% \begin{macro}{\seq_if_in:cxTF}
+% \begin{macro}{\seq_if_in:NnF}
+% \begin{macro}{\seq_if_in:cnF}
% |\seq_if_in:NnTF| \m{seq}\m{item} \m{true~case} \m{false~case}
% will check whether \m{item} is in \m{seq} and then either execute
% the \m{true~case} or the \m{false~case}. \m{true~case} and
-% \m{false~case} may contain incomplete |\if_char_code:w|
+% \m{false~case} may contain incomplete |\if_charcode:w|
% statements.
% \begin{macrocode}
\def_new:Npn \seq_if_in:NnTF #1#2{
@@ -528,9 +712,9 @@
% with |\q_no_value|.
% \begin{macrocode}
\if_meaning:NN\q_no_value##2
- \exp_after:NN\use_choice_ii:nn
+ \exp_after:NN\use_arg_ii:nn
\else:
- \exp_after:NN\use_choice_i:nn
+ \exp_after:NN\use_arg_i:nn
\fi:
}
\exp_after:NN
@@ -538,14 +722,23 @@
#2\seq_elt_end: \q_no_value \q_stop}
\def_new:Npn \seq_if_in:coTF {\exp_args:Nco \seq_if_in:NnTF}
\def_new:Npn \seq_if_in:cnTF {\exp_args:Nc \seq_if_in:NnTF}
+\def_new:Npn \seq_if_in:cxTF {\exp_args:Ncx \seq_if_in:NnTF}
% \end{macrocode}
+%
+% \begin{macrocode}
+\def_new:Npn \seq_if_in:NnF #1#2 { \seq_if_in:NnTF #1{#2}\use_noop: }
+\def_new:Npn \seq_if_in:cnF {\exp_args:Nc \seq_if_in:NnF}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
-% \subsection{Stack operations}
+% \subsubsection{Stack operations}
%
% We build stacks from sequences, but here we put the
% specific functions together.
@@ -577,6 +770,7 @@
% \begin{macro}{\seq_gpush:Nn}
% \begin{macro}{\seq_gpush:No}
% \begin{macro}{\seq_gpush:cn}
+% \begin{macro}{\seq_gpush:NC}
% \begin{macro}{\seq_gpop:NN}
% \begin{macro}{\seq_gpop:cN}
% I don't agree with Denys that one needs only local stacks,
@@ -587,6 +781,7 @@
\let_new:NN \seq_gpush:Nn \seq_gput_left:Nn
\def_new:Npn \seq_gpush:No {\exp_args:NNo \seq_gpush:Nn}
\def_new:Npn \seq_gpush:cn {\exp_args:Nc \seq_gpush:Nn}
+\def_new:Npn \seq_gpush:NC {\exp_args:NNC \seq_gpush:Nn}
\def_new:Npn \seq_gpop:NN {\seq_pop_aux:nnNN \tlp_gset:Nn \tlp_set:Nn}
\def_new:Npn \seq_gpop:cN {\exp_args:Nc \seq_gpop:NN}
% \end{macrocode}
@@ -595,6 +790,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
%
% \begin{macro}{\seq_top:NN}
@@ -611,12 +807,38 @@
%
% Show token usage:
% \begin{macrocode}
-%</package>
+%</initex|package>
%<*showmemory>
%\showMemUsage
%</showmemory>
% \end{macrocode}
%
+% \endinput
%
+% $Log$
+% Revision 1.23 2006/08/09 21:12:50 morten
+% Minor change in \seq_gconcat:NNN
+%
+% Revision 1.22 2006/03/20 18:26:39 braams
+% Updated the copyright notice (2006) and demoted all implementation
+% sections to subsections and so on to clean up the toc for source3.tex
+%
+% Revision 1.21 2005/12/29 01:28:29 morten
+% Added a new mapping function (needed in xparse)
+%
+% Revision 1.20 2005/12/27 10:06:10 morten
+% Minor changes plus changed RCS information retrieval
+%
+% Revision 1.19 2005/04/06 21:36:08 morten
+% Removed dependency on l3toks and added an if_in variant
+%
+% Revision 1.18 2005/03/22 23:28:05 morten
+% Fix coding as Benjamin pointed out
+%
+% Revision 1.17 2005/03/16 22:35:51 braams
+% Added the tweaks necessary to be able to load with initex
+%
+% Revision 1.16 2005/03/11 21:42:10 braams
+% Fixed the use of RCS information; added \StopEventually
+% Fixed a few documentation typos
%
-