summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-03-12 22:38:22 +0000
committerKarl Berry <karl@freefriends.org>2013-03-12 22:38:22 +0000
commit574c4946ce553944c797750da25ba8844775996f (patch)
tree9ea4729ca09c49a4564d99d9134a5417eb7b2af3 /Master/texmf-dist/source/latex/l3kernel
parent5c30ca128a813719715e012a0d72c1ccaba2d811 (diff)
latex3 (12mar13)
git-svn-id: svn://tug.org/texlive/trunk@29361 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/expl3.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3.ins93
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3basics.dtx39
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3box.dtx12
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx20
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3clist.dtx22
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx3
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx23
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx420
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3format.ins92
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx10
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx12
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp.dtx14
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3int.dtx219
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3keys.dtx9
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx10
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx37
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx339
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3seq.dtx33
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx186
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl.dtx35
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3token.dtx34
23 files changed, 930 insertions, 744 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index 8ea41c4eb2d..b7a91c8d848 100644
--- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: expl3.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: expl3.dtx Copyright (C) 1990-2013 The 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
@@ -49,8 +49,8 @@
%<*driver|package>
\def\ExplFileName{expl3}
\def\ExplFileDescription{L3 Experimental code bundle wrapper}
-\def\ExplFileDate{2012/12/21}
-\def\ExplFileVersion{4390}
+\def\ExplFileDate{2013/03/12}
+\def\ExplFileVersion{4467}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins
new file mode 100644
index 00000000000..b869a70fee5
--- /dev/null
+++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins
@@ -0,0 +1,93 @@
+\iffalse meta-comment
+
+File l3.ins Copyright (C) 2011,2012 The 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 "l3kernel 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.
+
+\fi
+
+\let\jobname\relax
+\input l3docstrip.dtx
+\askforoverwritefalse
+
+\preamble
+
+EXPERIMENTAL CODE
+
+Do not distribute this file without also distributing the
+source files specified above.
+
+Do not distribute a modified version of this file.
+
+\endpreamble
+% stop docstrip adding \endinput
+\postamble
+\endpostamble
+
+\keepsilent
+
+% ===== PACKAGE ONLY ======
+\generate{\file{expl3.sty} {\from{expl3.dtx} {package}}}
+% ========================
+\generate{\file{l3bootstrap.sty} {\from{l3bootstrap.dtx}{package}}}
+\generate{\file{l3names.sty} {\from{l3names.dtx} {package}}}
+\generate{\file{l3basics.sty} {\from{l3basics.dtx} {package}}}
+\generate{\file{l3expan.sty} {\from{l3expan.dtx} {package}}}
+\generate{\file{l3tl.sty} {\from{l3tl.dtx} {package}}}
+\generate{\file{l3seq.sty} {\from{l3seq.dtx} {package}}}
+\generate{\file{l3int.sty} {\from{l3int.dtx} {package}}}
+\generate{\file{l3quark.sty} {\from{l3quark.dtx} {package}}}
+\generate{\file{l3prg.sty} {\from{l3prg.dtx} {package}}}
+\generate{\file{l3clist.sty} {\from{l3clist.dtx} {package}}}
+\generate{\file{l3token.sty} {\from{l3token.dtx} {package}}}
+\generate{\file{l3prop.sty} {\from{l3prop.dtx} {package}}}
+\generate{\file{l3msg.sty} {\from{l3msg.dtx} {package}}}
+\generate{\file{l3file.sty} {\from{l3file.dtx} {package}}}
+\generate{\file{l3skip.sty} {\from{l3skip.dtx} {package}}}
+\generate{\file{l3keys.sty} {\from{l3keys.dtx} {package}}}
+\generate
+ {%
+ \file{l3fp.sty}
+ {%
+ \from{l3fp.dtx} {package}
+ \from{l3fp-aux.dtx} {package}
+ \from{l3fp-traps.dtx} {package}
+ \from{l3fp-round.dtx} {package}
+ \from{l3fp-parse.dtx} {package}
+ \from{l3fp-logic.dtx} {package}
+ \from{l3fp-basics.dtx} {package}
+ \from{l3fp-extended.dtx}{package}
+ \from{l3fp-expo.dtx} {package}
+ \from{l3fp-trig.dtx} {package}
+ \from{l3fp-convert.dtx} {package}
+ \from{l3fp-assign.dtx} {package}
+ \from{l3fp-old.dtx} {package}
+ }%
+ }
+\generate{\file{l3box.sty} {\from{l3box.dtx} {package}}}
+\generate{\file{l3coffins.sty} {\from{l3coffins.dtx} {package}}}
+\generate{\file{l3color.sty} {\from{l3color.dtx} {package}}}
+\generate{\file{l3luatex.sty} {\from{l3luatex.dtx} {package}}}
+\generate{\file{l3candidates.sty}{\from{l3candidates.dtx}{package}}}
+
+\generate{\file{l3doc.cls} {\from{l3doc.dtx} {class}}}
+\generate{\file{l3doc.ist} {\from{l3doc.dtx} {docist}}}
+
+\generate{\file{l3dvipdfmx.def} {\from{l3drivers.dtx} {package,dvipdfmx} }}
+\generate{\file{l3dvips.def} {\from{l3drivers.dtx} {package,dvips} }}
+\generate{\file{l3pdfmode.def} {\from{l3drivers.dtx} {package,pdfmode} }}
+\generate{\file{l3xdvipdfmx.def} {\from{l3drivers.dtx} {package,xdvipdfmx}}}
+
+\generate{\file{l3docstrip.tex} {\from{l3docstrip.dtx} {program}}}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
index 733beefe452..98fe66d8b35 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3basics.dtx Copyright (C) 1990-2012 The LaTeX3 project
+%% File: l3basics.dtx Copyright (C) 1990-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3basics.dtx 4339 2012-11-24 19:16:43Z joseph $
+\GetIdInfo$Id: l3basics.dtx 4428 2013-01-10 13:23:29Z bruno $
{L3 Basic definitions}
%</driver|package>
%<*driver>
@@ -183,8 +183,28 @@
% \cs{par} tokens but the function will not expand within an
% \texttt{x}-type expansion.
% \end{description}
+%
+% Finally, the functions in
+% Subsections~\ref{sec:defining-new-function-1}~and
+% \ref{sec:defining-new-function-2} are primarily meant to define
+% \emph{base functions} only. Base functions can only have the following
+% argument specifiers:
+% \begin{description}
+% \item[|N| and |n|] No manipulation.
+% \item[|T| and |F|] Functionally equivalent to |n| (you are actually
+% encouraged to use the family of |\prg_new_conditional:| functions
+% described in Section~\ref{sec:new-conditional-functions}).
+% \item[|p| and |w|] These are special cases.
+% \end{description}
+%
+% The |\cs_new:| functions below (and friends) do not stop you from using
+% other argument specifiers in your function names, but they do not handle
+% expansion for you. You should define the base function and then use
+% \cs{cs_generate_variant:Nn} to generate custom variants as described in
+% Section~\ref{sec:defining-variants}.
%
% \subsection{Defining new functions using parameter text}
+% \label{sec:defining-new-function-1}
%
% \begin{function}{\cs_new:Npn, \cs_new:cpn, \cs_new:Npx, \cs_new:cpx}
% \begin{syntax}
@@ -373,6 +393,7 @@
% \end{function}
%
% \subsection{Defining new functions using the signature}
+% \label{sec:defining-new-function-2}
%
% \begin{function}
% {
@@ -777,7 +798,7 @@
%
% \begin{function}[EXP]{\cs_to_str:N}
% \begin{syntax}
-% \cs{cs_to_str:N} \Arg{control sequence}
+% \cs{cs_to_str:N} \meta{control sequence}
% \end{syntax}
% Converts the given \meta{control sequence} into a series of
% characters with category code $12$ (other), except spaces,
@@ -1131,7 +1152,7 @@
% ~~|}| \\
% ~~\Arg{else code}
% \end{syntax}
-% This function comapres the full expansion of the \meta{test string}
+% This function compares the full expansion of the \meta{test string}
% in turn with the full expansion of the \meta{string cases}. If the two
% full expansions are equal (as described for \cs{str_if_eq:nnTF} then the
% associated \meta{code} is left in the input stream. If none of the tests
@@ -1145,7 +1166,7 @@
%
% \begin{function}[updated = 2011-09-06,EXP,pTF]{\luatex_if_engine:}
% \begin{syntax}
-% \cs{luatex_if_luatex:TF} \Arg{true code} \Arg{false code}
+% \cs{luatex_if_engine:TF} \Arg{true code} \Arg{false code}
% \end{syntax}
% Detects is the document is being compiled using \LuaTeX{}.
% \end{function}
@@ -2608,7 +2629,7 @@
% \TeX{} conditionals in case |#1| is unbalanced in this matter.
% \begin{macrocode}
\cs_new_protected:Npn \cs_undefine:N #1
- { \cs_gset_eq:NN #1 \c_undefined:D }
+ { \cs_gset_eq:NN #1 \tex_undefined:D }
\cs_new_protected:Npn \cs_undefine:c #1
{
\if_cs_exist:w #1 \cs_end:
@@ -2616,7 +2637,7 @@
\else:
\exp_after:wN \use_none:n
\fi:
- { \cs_gset_eq:cN {#1} \c_undefined:D }
+ { \cs_gset_eq:cN {#1} \tex_undefined:D }
}
% \end{macrocode}
% \end{macro}
@@ -3226,16 +3247,20 @@
% \begin{macro}[pTF, EXP]{\str_if_eq:xx}
% Not really true \texttt{x}-type expansion
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \str_if_eq_p:xx \str_if_eq_x_p:nn
\cs_new_eq:NN \str_if_eq:xxT \str_if_eq_x:nnT
\cs_new_eq:NN \str_if_eq:xxF \str_if_eq_x:nnF
\cs_new_eq:NN \str_if_eq:xxTF \str_if_eq_x:nnTF
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\chk_if_free_cs:N}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \chk_if_free_cs:N \__chk_if_free_cs:N
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
index fc1ae68b7c2..9ce55b15be3 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3bootstrap.dtx Copyright (C) 2011-2012 The LaTeX3 project
+%% File: l3bootstrap.dtx Copyright (C) 2011-2013 The 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
@@ -119,7 +119,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-\GetIdInfo$Id: l3bootstrap.dtx 3991 2012-07-16 19:00:35Z joseph $
+\GetIdInfo$Id: l3bootstrap.dtx 4420 2013-01-08 20:00:04Z joseph $
{L3 Bootstrap code}
%</driver|package>
%<*driver>
@@ -672,6 +672,7 @@
% package or format itself. Using an \tn{edef} here makes the
% definitions that bit clearer later.
% \begin{macrocode}
+%<*deprecated>
\protected\edef\ExplSyntaxNamesOn
{%
\expandafter\noexpand
@@ -686,6 +687,7 @@
\expandafter\noexpand
\csname\detokenize{char_set_catcode_math_subscript:n}\endcsname{95}%
}
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index c6ccdfb12a9..b6e89bde0be 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3box.dtx 4347 2012-12-08 09:11:29Z joseph $
+\GetIdInfo$Id: l3box.dtx 4411 2013-01-08 12:21:52Z bruno $
{L3 Experimental boxes}
%</driver|package>
%<*driver>
@@ -760,14 +760,8 @@
% \begin{macro}[pTF]{\box_if_exist:N, \box_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \box_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \box_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \box_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \box_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \box_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \box_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \box_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \box_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \box_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \box_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
index 4aa22e27714..88a4d9898b5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
@@ -36,7 +36,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3candidates.dtx 4383 2012-12-20 15:10:48Z bruno $
+\GetIdInfo$Id: l3candidates.dtx 4466 2013-03-09 14:58:43Z joseph $
{L3 Experimental additions to l3kernel}
%</driver|package>
%<*driver>
@@ -406,7 +406,7 @@
% \cs{ior_str_map_inline:Nn} \Arg{stream} \Arg{inline function}
% \end{syntax}
% Applies the \meta{inline function} to every \meta{line}
-% in the \meta{sream}. The material is read from the \meta{stream}
+% in the \meta{stream}. The material is read from the \meta{stream}
% as a series of tokens with category code $12$ (other), with the
% exception of space characters which are given category code $10$
% (space). The \meta{inline function} should consist of code which
@@ -2243,12 +2243,14 @@
\cs_new:Npn \prop_map_tokens:Nn #1#2
{
\exp_last_unbraced:Nno \@@_map_tokens:nwn {#2} #1
- \q_recursion_tail \q__prop { }
+ \s_@@ \q_recursion_tail \s_@@ { }
\__prg_break_point:Nn \prop_map_break: { }
}
-\cs_new:Npn \@@_map_tokens:nwn #1 \q__prop #2 \q__prop #3
+\cs_new:Npn \@@_map_tokens:nwn #1 \s_@@ #2 \s_@@ #3
{
- \__quark_if_recursion_tail_break:NN #2 \prop_map_break:
+ \if_meaning:w \q_recursion_tail #2
+ \exp_after:wN \prop_map_break:
+ \fi:
\use:n {#1} {#2} {#3}
\@@_map_tokens:nwn {#1}
}
@@ -2271,10 +2273,10 @@
{
\exp_last_unbraced:Noo \@@_get_Nn:nwn
{ \tl_to_str:n {#2} } #1
- \tl_to_str:n {#2} \q__prop { }
+ \tl_to_str:n {#2} \q_@@ { }
\__prg_break_point:
}
-\cs_new:Npn \@@_get_Nn:nwn #1 \q__prop #2 \q__prop #3
+\cs_new:Npn \@@_get_Nn:nwn #1 \q_@@ #2 \q_@@ #3
{
\str_if_eq_x:nnTF {#1} {#2}
{ \__prg_break:n { \exp_not:n {#3} } }
@@ -2886,11 +2888,11 @@
\exp_after:wN \@@_false:w
\fi:
}
- \cs_new_protected_nopar:Npn \@@_N_type:w #1 OUTER #2 \q_mark #3
+ \cs_new_protected:Npn \@@_N_type:w #1 OUTER #2 \q_mark #3
{ #3 {#1} {#2} }
}
\group_end:
-\cs_new_protected_nopar:Npn \@@_N_type_aux:nnw #1 #2 #3 \fi:
+\cs_new_protected:Npn \@@_N_type_aux:nnw #1 #2 #3 \fi:
{
\fi:
\tl_if_in:noTF {#1} { \tl_to_str:n {ma} }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
index 68c36d63a4a..333bbb9402a 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
@@ -2,7 +2,7 @@
%
%% File: l3clist.dtx Copyright (C) 2004-2011 Frank Mittelbach,
%% The LaTeX3 project
-%% (C) 2012 The LaTeX3 Project
+%% (C) 2012,2013 The 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
@@ -37,7 +37,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3clist.dtx 4339 2012-11-24 19:16:43Z joseph $
+\GetIdInfo$Id: l3clist.dtx 4414 2013-01-08 12:32:12Z bruno $
{L3 Comma separated lists}
%</driver|package>
%<*driver>
@@ -690,14 +690,8 @@
% \begin{macro}[pTF]{\clist_if_exist:N, \clist_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \clist_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \clist_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \clist_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \clist_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \clist_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \clist_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \clist_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \clist_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \clist_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \clist_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1454,10 +1448,12 @@
% {\clist_if_eq:NN, \clist_if_eq:Nc, \clist_if_eq:cN, \clist_if_eq:cc}
% Simple copies from the token list variable material.
% \begin{macrocode}
-\prg_new_eq_conditional:NNn \clist__if_eq:NN \tl_if_eq:NN { p , T , F , TF }
+%<*deprecated>
+\prg_new_eq_conditional:NNn \clist_if_eq:NN \tl_if_eq:NN { p , T , F , TF }
\prg_new_eq_conditional:NNn \clist_if_eq:Nc \tl_if_eq:Nc { p , T , F , TF }
\prg_new_eq_conditional:NNn \clist_if_eq:cN \tl_if_eq:cN { p , T , F , TF }
\prg_new_eq_conditional:NNn \clist_if_eq:cc \tl_if_eq:cc { p , T , F , TF }
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1465,9 +1461,11 @@
%
% \begin{macro}{\clist_length:N, \clist_length:c, \clist_length:n}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \clist_length:N \clist_count:N
\cs_new_eq:NN \clist_length:n \clist_count:c
\cs_new_eq:NN \clist_length:c \clist_count:n
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1475,8 +1473,10 @@
%
% \begin{macro}{\clist_use:N, \clist_use:c}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \clist_use:N \tl_use:N
\cs_new_eq:NN \clist_use:c \tl_use:c
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index f6734d35f46..073a979140e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -78,7 +78,7 @@ Do not distribute a modified version of this file.
%</driver|class>
%
%<*driver|class>
-\GetIdInfo$Id: l3doc.dtx 4267 2012-11-04 19:42:13Z joseph $
+\GetIdInfo$Id: l3doc.dtx 4442 2013-01-13 08:56:27Z bruno $
{L3 Experimental documentation class}
%</driver|class>
%
@@ -1751,6 +1751,7 @@ Do not distribute a modified version of this file.
{
\seq_use:Nnnn \g_@@_tmpa_seq
{ \,~and~ } { \,,~ } { \,,~and~ }
+ \@.
}
{ \seq_item:Nn \g_@@_tmpa_seq {1}\,~and~others. }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
index d912433ee8d..739acab95e5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3expan.dtx 4149 2012-08-28 10:50:40Z bruno $
+\GetIdInfo$Id: l3expan.dtx 4458 2013-02-03 15:49:37Z bruno $
{L3 Argument expansion}
%</driver|package>
%<*driver>
@@ -78,6 +78,7 @@
% variants.
%
% \section{Defining new variants}
+% \label{sec:defining-variants}
%
% The definition of variant forms for base functions may be necessary
% when writing new functions or when applying a kernel function in a
@@ -193,22 +194,22 @@
% specific expansion steps are needed, such as when using delimited
% arguments, should the lower-level functions with |o| specifiers be employed.
%
-% The |f| type is so special that it deserves an example.
-% Let's pretend we want to set |\aaa| equal to the control sequence
-% stemming from turning |b \l_tmpa_tl b| into a control
-% sequence. Furthermore we want to store the execution of it in a
+% The |f| type is so special that it deserves an example. Let's pretend
+% we want to set the control sequence whose name is given by
+% |b \l_tmpa_tl b| equal to the list of tokens |\aaa a|. Furthermore we
+% want to store the execution of it in a
% \meta{tl~var}. In this example we assume |\l_tmpa_tl| contains
% the text string |lur|. The straightforward approach is
% \begin{quote}
-% |\tl_set:No \l_tmpb_tl { \cs_set_eq:Nc \aaa { b \l_tmpa_tl b } }|
+% |\tl_set:No \l_tmpb_tl { \tl_set:cn { b \l_tmpa_tl b } { \aaa a } }|
% \end{quote}
% Unfortunately this only puts
-% |\exp_args:NNc \cs_set_eq:NN \aaa {b \l_tmpa_tl b}| into |\l_tmpb_tl|
-% and not |\cs_set_eq:NN \aaa = \blurb| as we probably wanted. Using
-% \cs{tl_set:Nx} is not an option as that will die horribly. Instead
-% we can do a
+% |\exp_args:Nc \tl_set:Nn {b \l_tmpa_tl b} { \aaa a }| into
+% |\l_tmpb_tl| and not |\tl_set:Nn \blurb { \aaa a }| as we probably
+% wanted. Using \cs{tl_set:Nx} is not an option as that will die
+% horribly. Instead we can do a
% \begin{quote}
-% |\tl_set:Nf \l_tmpb_tl { \cs_set_eq:Nc \aaa { b \l_tmpa_tl b } }|
+% |\tl_set:Nf \l_tmpb_tl { \tl_set:cn { b \l_tmpa_tl b } { \aaa a } }|
% \end{quote}
% which puts the desired result in |\l_tmpb_tl|. It requires
% \cs{tl_set:Nf} to be defined as
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index 416fc76cacb..67461fd01c9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3file.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3file.dtx Copyright (C) 1990-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3file.dtx 4377 2012-12-20 11:13:29Z bruno $
+\GetIdInfo$Id: l3file.dtx 4446 2013-01-14 00:03:17Z bruno $
{L3 File and I/O operations}
%</driver|package>
%<*driver>
@@ -192,6 +192,20 @@
% allocated to \meta{file name} until a \cs{ior_close:N} instruction
% is given or the \TeX{} run ends.
% \end{function}
+%
+% \begin{function}[added = 2013-01-12, TF]{\ior_open:Nn, \ior_open:cn}
+% \begin{syntax}
+% \cs{ior_open:NnTF} \meta{stream} \Arg{file name} \Arg{true code} \Arg{false code}
+% \end{syntax}
+% Opens \meta{file name} for reading using \meta{stream} as the
+% control sequence for file access. If the \meta{stream} was already
+% open it is closed before the new operation begins. The
+% \meta{stream} is available for access immediately and will remain
+% allocated to \meta{file name} until a \cs{ior_close:N} instruction
+% is given or the \TeX{} run ends. The \meta{true code} is then inserted
+% into the input stream. If the file is not found, no error is raised and
+% the \meta{false code} is inserted into the input stream.
+% \end{function}
%
% \begin{function}[updated = 2012-02-09]{\iow_open:Nn, \iow_open:cn}
% \begin{syntax}
@@ -645,11 +659,11 @@
{ \@@_name_sanitize:nn {#1} { \@@_add_path:nN } }
\cs_new_protected:Npn \@@_add_path:nN #1#2
{
- \__ior_open:Nn \g__file_internal_ior {#1}
- \ior_if_eof:NTF \g__file_internal_ior
+ \__ior_open:Nn \g_@@_internal_ior {#1}
+ \ior_if_eof:NTF \g_@@_internal_ior
{ \@@_add_path_search:nN {#1} #2 }
{ \tl_set:Nn #2 {#1} }
- \ior_close:N \g__file_internal_ior
+ \ior_close:N \g_@@_internal_ior
}
\cs_new_protected:Npn \@@_add_path_search:nN #1#2
{
@@ -665,8 +679,8 @@
%</package>
\seq_map_inline:Nn \l_@@_search_path_seq
{
- \__ior_open:Nn \g__file_internal_ior { ##1 #1 }
- \ior_if_eof:NF \g__file_internal_ior
+ \__ior_open:Nn \g_@@_internal_ior { ##1 #1 }
+ \ior_if_eof:NF \g_@@_internal_ior
{
\tl_set:Nx #2 { ##1 #1 }
\seq_map_break:
@@ -824,71 +838,41 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\c_@@_streams_tl}
-% The list of streams available, by number.
+% \begin{variable}{\g_@@_streams_seq}
+% A list of the currently-available input streams to be used as a
+% stack. In format mode, all streams (from $0$ to~$15$) are
+% available, while the package requests streams to \LaTeXe{} as they
+% are needed (initially none are needed), so the starting point
+% varies!
% \begin{macrocode}
-\tl_const:Nn \c_@@_streams_tl
- {
- \c_zero
- \c_one
- \c_two
- \c_three
- \c_four
- \c_five
- \c_six
- \c_seven
- \c_eight
- \c_nine
- \c_ten
- \c_eleven
- \c_twelve
- \c_thirteen
- \c_fourteen
- \c_fifteen
- }
+\seq_new:N \g_@@_streams_seq
+%<*initex>
+\seq_gset_split:Nnn \g_@@_streams_seq { , }
+ { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 }
+%</initex>
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_streams_prop}
-% The allocations for streams are stored in property lists, which
-% are set up to have a \enquote{full} set of allocations from the start.
-% In package mode, a few slots are always taken, so these are
-% blocked off from use.
+% \begin{variable}{\l_@@_stream_tl}
+% Used to recover the raw stream number from the stack.
% \begin{macrocode}
-\prop_new:N \g_@@_streams_prop
-%<*package>
-\prop_put:Nnn \g_@@_streams_prop { 0 } { LaTeX2e~reserved }
-%</package>
+\tl_new:N \l_@@_stream_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_stream_int}
-% Used to track the number allocated to the stream being created:
-% this is taken from the property list but does alter.
+% \begin{variable}{\g_@@_streams_prop}
+% The name of the file attached to each stream is tracked in a property
+% list.
% \begin{macrocode}
-\int_new:N \l_@@_stream_int
+\prop_new:N \g_@@_streams_prop
+%<*package>
+\prop_gput:Nnn \g_@@_streams_prop { 0 } { LaTeX2e~reserved }
+%</package>
% \end{macrocode}
% \end{variable}
%
% \subsubsection{Stream management}
%
-% \begin{macro}[int]{\@@_new:N, \@@_new:c}
-% The lowest level for stream management is actually creating raw \TeX{}
-% streams. As these are very limited (even with \eTeX{}), this should not
-% be addressed directly.
-% \begin{macrocode}
-%<*initex>
-\__alloc_setup_type:nnn { ior } \c_zero \c_sixteen
-\cs_new_protected:Npn \@@_new:N #1
- { \__alloc_reg:nNN { ior } \tex_chardef:D #1 }
-%</initex>
-%<*package>
-\cs_set_eq:NN \@@_new:N \newread
-%</package>
-\cs_generate_variant:Nn \@@_new:N { c }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\ior_new:N, \ior_new:c}
% Reserving a new stream is done by defining the name as equal to using the
% terminal.
@@ -897,27 +881,14 @@
\cs_generate_variant:Nn \ior_new:N { c }
% \end{macrocode}
% \end{macro}
-%
-% \begin{variable}{\g__file_internal_ior}
-% Delayed from the \texttt{file} section so that the mechanisms are in place.
-% \begin{macrocode}
-\ior_new:N \g__file_internal_ior
-% \end{macrocode}
-% \end{variable}
-%
+%
% \begin{macro}{\ior_open:Nn, \ior_open:cn}
-% \begin{macro}[TF]{\ior_open:Nn}
% \begin{macro}[aux]{\@@_open_aux:Nn}
-% \begin{macro}[aux]{\@@_open_aux:NnTF}
-% \begin{macro}[aux]{\@@_open:Nn, \@@_open:No}
-% Opening a stream starts with a call to the closing function: this is
-% safest. There is then a loop through the allocation number list to find
-% the first free stream number. When one is found the allocation can take
-% place, the information can be stored and finally the file can actually be
-% opened. Before any actual file operations there is a precaution against
-% special characters in file names. There is an intermediate auxiliary to
-% allow path addition, keeping the internal function fast and avoiding an
-% infinite loop.
+% Opening an input stream requires a bit of pre-processing. The file name
+% is sanitized to deal with active characters, before an auxiliary adds a
+% path and checks that the file really exists. If those two tests pass, then
+% pass the information on to the lower-level function which deals with
+% streams.
% \begin{macrocode}
\cs_new_protected:Npn \ior_open:Nn #1#2
{ \__file_name_sanitize:nn {#2} { \@@_open_aux:Nn #1 } }
@@ -929,8 +900,20 @@
{ \__msg_kernel_error:nnx { kernel } { file-not-found } {#2} }
{ \@@_open:No #1 \l__file_internal_name_tl }
}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[TF]{\ior_open:Nn, \ior_open:cn}
+% \begin{macro}[aux]{\@@_open_aux:NnTF}
+% Much the same idea for opening a read with a conditional, except the
+% auxiliary function does not issue an error if the file is not found.
+% \begin{macrocode}
\prg_new_protected_conditional:Npnn \ior_open:Nn #1#2 { T , F , TF }
- { \__file_name_sanitize:nn {#2} { \@@_open_aux:NnTF #1 } }
+ { \__file_name_sanitize:nn {#2} { \@@_open:NnTF #1 } }
+\cs_generate_variant:Nn \ior_open:NnT { c }
+\cs_generate_variant:Nn \ior_open:NnF { c }
+\cs_generate_variant:Nn \ior_open:NnTF { c }
\cs_new_protected:Npn \@@_open_aux:NnTF #1#2
{
\file_add_path:nN {#2} \l__file_internal_name_tl
@@ -941,115 +924,63 @@
\prg_return_true:
}
}
-\cs_generate_variant:Nn \ior_open:NnT { c }
-\cs_generate_variant:Nn \ior_open:NnF { c }
-\cs_generate_variant:Nn \ior_open:NnTF { c }
-\cs_new_protected:Npn \@@_open:Nn #1#2
- {
- \ior_close:N #1
- \int_set_eq:NN \l_@@_stream_int \c_sixteen
- \tl_map_function:NN \c_@@_streams_tl \@@_alloc:n
- \int_compare:nNnTF \l_@@_stream_int = \c_sixteen
- { \__msg_kernel_fatal:nn { kernel } { input-streams-exhausted } }
- {
- \@@_alloc:N #1
- \prop_gput:NVn \g_@@_streams_prop \l_@@_stream_int {#2}
- \tex_openin:D #1#2 \scan_stop:
- }
- }
-\cs_generate_variant:Nn \@@_open:Nn { No }
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[aux]{\@@_alloc:n}
-% See if a particular stream is available: the property list contains file
-% names for streams in use, so any unused ones are for the taking.
+%
+% \begin{macro}[int]{\@@_open:Nn, \@@_open:No}
+% \begin{macro}[aux]{\@@_open_stream:Nn}
+% The stream allocation itself uses the fact that there is a list of all of
+% those available, so allocation is simply a question of using the number at
+% the top of the list. In package mode, life gets more complex as it's
+% important to keep things in sync. That is done using a two-part approach:
+% any streams that have already been taken up by \pkg{ior} but are now free
+% are tracked, so we first try those. If that fails, ask \LaTeXe{} for a new
+% stream and use that number (after a bit of conversion).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_alloc:n #1
- {
- \prop_if_in:NnF \g_@@_streams_prop {#1}
- {
- \int_set:Nn \l_@@_stream_int {#1}
- \tl_map_break:
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[aux]{\@@_alloc:N}
-% \begin{macro}[aux]{\@@_alloc:}
-% \begin{variable}{\g_@@_internal_ior}
-% Allocating a raw stream is much easier in \IniTeX{} mode than for the
-% package. For the format, all streams will be allocated by \pkg{l3file} and
-% so there is a simple check to see if a raw stream is actually available. On
-% the other hand, for the package there will be non-managed streams. So if
-% the managed one is not open, a check is made to see if some other managed
-% stream is available before deciding to open a new one. If a new one is
-% needed, we get the number allocated by \LaTeXe{} to get \enquote{back on
-% track} with allocation.
-% \begin{macrocode}
-\ior_new:N \g_@@_internal_ior
-\cs_new_protected:Npn \@@_alloc:N #1
+\cs_new_protected:Npn \@@_open:Nn #1#2
{
- \cs_if_exist:cF { g_ior_ \int_use:N \l_@@_stream_int _ior }
- {
-%<*package>
- \@@_alloc:
- \int_compare:nNnT \l_@@_stream_int = \c_sixteen
- {
- \@@_new:N \g_@@_internal_ior
- \int_set:Nn \l_@@_stream_int { \g_@@_internal_ior }
- \cs_gset_eq:cN
- { g_ior_ \int_use:N \l_@@_stream_int _ior } \g_@@_internal_ior
- }
-%</package>
+ \ior_close:N #1
+ \seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl
+ { \@@_open_stream:Nn #1 {#2} }
%<*initex>
- \@@_new:c { g_ior_ \int_use:N \l_@@_stream_int _ior }
+ { \__msg_kernel_fatal:nn { kernel } { input-streams-exhausted } }
%</initex>
- }
- \cs_gset_eq:Nc #1 { g_ior_ \int_use:N \l_@@_stream_int _ior }
- }
%<*package>
-\cs_new_protected_nopar:Npn \@@_alloc:
- {
- \int_incr:N \l_@@_stream_int
- \int_compare:nNnT \l_@@_stream_int < \c_sixteen
{
- \cs_if_exist:cTF { g_ior_ \int_use:N \l_@@_stream_int _ior }
- {
- \prop_if_in:NVT \g_@@_streams_prop \l_@@_stream_int
- { \@@_alloc: }
- }
- { \@@_alloc: }
+ \newread #1
+ \tl_set:Nx \l_@@_stream_tl { \int_eval:n {#1} }
+ \@@_open_stream:Nn #1 {#2}
}
- }
%</package>
+ }
+\cs_generate_variant:Nn \@@_open:Nn { No }
+\cs_new_protected:Npn \@@_open_stream:Nn #1#2
+ {
+ \tex_global:D \tex_chardef:D #1 = \l_@@_stream_tl \scan_stop:
+ \prop_gput:NVn \g_@@_streams_prop #1 {#2}
+ \tex_openin:D #1 #2 \scan_stop:
+ }
% \end{macrocode}
-% \end{variable}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ior_close:N, \ior_close:c}
-% Closing a stream is not quite the reverse of opening one. First,
-% the close operation is easier than the open one, and second as the
-% stream is actually a number we can use it directly to show that the
-% slot has been freed up.
+% Closing a stream means getting rid of it at the \TeX{} level and
+% removing from the various data structures. Unless the name passed
+% is an invalid stream number (outside the range $[0,15]$), it can be
+% closed. On the other hand, it only gets added to the stack if it
+% was not already there, to avoid duplicates building up.
% \begin{macrocode}
\cs_new_protected:Npn \ior_close:N #1
{
- \__chk_if_exist_cs:N #1
- \int_compare:nNnF #1 < \c_zero
+ \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
{
- \int_compare:nNnF #1 > \c_fifteen
- {
- \tex_closein:D #1
- \prop_gremove:NV \g_@@_streams_prop #1
- \cs_gset_eq:NN #1 \c_term_ior
- }
+ \tex_closein:D #1
+ \prop_gremove:NV \g_@@_streams_prop #1
+ \seq_if_in:NVF \g_@@_streams_seq #1
+ { \seq_gpush:NV \g_@@_streams_seq #1 }
+ \cs_gset_eq:NN #1 \c_term_ior
}
}
\cs_generate_variant:Nn \ior_close:N { c }
@@ -1135,6 +1066,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\g__file_internal_ior}
+% Needed by the higher-level code, but cannot be created until here.
+% \begin{macrocode}
+\ior_new:N \g__file_internal_ior
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Output operations}
%
% \begin{macrocode}
@@ -1142,7 +1080,8 @@
% \end{macrocode}
%
% There is a lot of similarity here to the input operations, at least for
-% many of the basics. Thus quite a bit is copied from the earlier material.
+% many of the basics. Thus quite a bit is copied from the earlier material
+% with minor alterations.
%
% \subsubsection{Variables and constants}
%
@@ -1156,11 +1095,22 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\c_@@_streams_tl}
-% The list of streams available, by number: copied from the input
-% operations.
+% \begin{variable}{\g_@@_streams_seq}
+% A list of the currently-available input streams to be used as a stack.
+% Things are done differently in format and package mode, so the starting
+% point varies!
% \begin{macrocode}
-\cs_new_eq:NN \c_@@_streams_tl \c__ior_streams_tl
+\seq_new:N \g_@@_streams_seq
+%<*initex>
+\seq_gset_eq:NN \g_@@_streams_seq \g__ior_streams_seq
+%</initex>
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_stream_tl}
+% Used to recover the raw stream number from the stack.
+% \begin{macrocode}
+\tl_new:N \l_@@_stream_tl
% \end{macrocode}
% \end{variable}
%
@@ -1176,32 +1126,8 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_stream_int}
-% Used to track the number allocated to the stream being created:
-% this is taken from the property list but does alter. The two allocation
-% routines only need one register, so we save one here.
-% \begin{macrocode}
-\cs_new_eq:NN \l_@@_stream_int \l__ior_stream_int
-% \end{macrocode}
-% \end{variable}
-%
% \subsection{Stream management}
%
-% \begin{macro}[aux]{\@@_new:N, \@@_new:c}
-% The same idea as for input, but with a separate set of functions.
-% \begin{macrocode}
-%<*initex>
-\__alloc_setup_type:nnn { iow } \c_zero \c_sixteen
-\cs_new_protected:Npn \@@_new:N #1
- { \__alloc_reg:nNN { iow } \tex_chardef:D #1 }
-%</initex>
-%<*package>
-\cs_set_eq:NN \@@_new:N \newwrite
-%</package>
-\cs_generate_variant:Nn \@@_new:N { c }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\iow_new:N, \iow_new:c}
% Reserving a new stream is done by defining the name as equal to writing
% to the terminal: odd but at least consistent.
@@ -1212,8 +1138,10 @@
% \end{macro}
%
% \begin{macro}{\iow_open:Nn, \iow_open:cn}
-% \begin{macro}[aux]{\@@_open:Nn}
-% The same idea as for reading, but without the path.
+% \begin{macro}[int]{\@@_open:Nn}
+% \begin{macro}[aux]{\@@_open_stream:Nn}
+% The same idea as for reading, but without the path and without the need
+% to allow for a conditional version.
% \begin{macrocode}
\cs_new_protected:Npn \iow_open:Nn #1#2
{ \__file_name_sanitize:nn {#2} { \@@_open:Nn #1 } }
@@ -1221,78 +1149,28 @@
\cs_new_protected:Npn \@@_open:Nn #1#2
{
\iow_close:N #1
- \int_set_eq:NN \l_@@_stream_int \c_sixteen
- \tl_map_function:NN \c_@@_streams_tl \@@_alloc:n
- \int_compare:nNnTF \l_@@_stream_int = \c_sixteen
+ \seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl
+ { \@@_open_stream:Nn #1 {#2} }
+%<*initex>
{ \__msg_kernel_fatal:nn { kernel } { output-streams-exhausted } }
+%</initex>
+%<*package>
{
- \@@_alloc:N #1
- \prop_gput:NVn \g_@@_streams_prop \l_@@_stream_int {#2}
- \tex_immediate:D \tex_openout:D #1#2 \scan_stop:
- }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[aux]{\@@_alloc:n}
-% Identical to the input routine, but with the appropriate names used
-% (when \pkg{l3docstrip} has done it's job!).
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_alloc:n #1
- {
- \prop_if_in:NnF \g_@@_streams_prop {#1}
- {
- \int_set:Nn \l_@@_stream_int {#1}
- \tl_map_break:
+ \newwrite #1
+ \tl_set:Nx \l_@@_stream_tl { \int_eval:n {#1} }
+ \@@_open_stream:Nn #1 {#2}
}
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[aux]{\@@_alloc:N}
-% \begin{macro}[aux]{\@@_alloc:}
-% \begin{variable}{\g_@@_internal_iow}
-% Exactly the same as for reading!
-% \begin{macrocode}
-\iow_new:N \g_@@_internal_iow
-\cs_new_protected:Npn \@@_alloc:N #1
- {
- \cs_if_exist:cF { g_iow_ \int_use:N \l_@@_stream_int _iow }
- {
-%<*package>
- \@@_alloc:
- \int_compare:nNnT \l_@@_stream_int = \c_sixteen
- {
- \@@_new:N \g_@@_internal_iow
- \int_set:Nn \l_@@_stream_int { \g_@@_internal_iow }
- \cs_gset_eq:cN
- { g_iow_ \int_use:N \l_@@_stream_int _iow } \g_@@_internal_iow
- }
%</package>
-%<*initex>
- \@@_new:c { g_iow_ \int_use:N \l_@@_stream_int _iow }
-%</initex>
- }
- \cs_gset_eq:Nc #1 { g_iow_ \int_use:N \l_@@_stream_int _iow }
}
-%<*package>
-\cs_new_protected_nopar:Npn \@@_alloc:
+\cs_generate_variant:Nn \@@_open:Nn { No }
+\cs_new_protected:Npn \@@_open_stream:Nn #1#2
{
- \int_incr:N \l_@@_stream_int
- \int_compare:nNnT \l_@@_stream_int < \c_sixteen
- {
- \cs_if_exist:cTF { g_iow_ \int_use:N \l_@@_stream_int _iow }
- {
- \prop_if_in:NVT \g_@@_streams_prop \l_@@_stream_int
- { \@@_alloc: }
- }
- { \@@_alloc: }
- }
+ \tex_global:D \tex_chardef:D #1 = \l_@@_stream_tl \scan_stop:
+ \prop_gput:NVn \g_@@_streams_prop #1 {#2}
+ \tex_immediate:D \tex_openout:D #1 #2 \scan_stop:
}
-%</package>
% \end{macrocode}
-% \end{variable}
+% \end{macro}
% \end{macro}
% \end{macro}
%
@@ -1304,15 +1182,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \iow_close:N #1
{
- \__chk_if_exist_cs:N #1
- \int_compare:nNnF #1 < \c_zero
+ \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
{
- \int_compare:nNnF #1 > \c_fifteen
- {
- \tex_immediate:D \tex_closeout:D #1
- \prop_gremove:NV \g_@@_streams_prop #1
- \cs_gset_eq:NN #1 \c_term_iow
- }
+ \tex_immediate:D \tex_closeout:D #1
+ \prop_gremove:NV \g_@@_streams_prop #1
+ \seq_if_in:NVF \g_@@_streams_seq #1
+ { \seq_gpush:NV \g_@@_streams_seq #1 }
+ \cs_gset_eq:NN #1 \c_term_ior
}
}
\cs_generate_variant:Nn \iow_close:N { c }
@@ -1809,8 +1685,10 @@
% \begin{macro}{\iow_wrap:xnnnN}
% This was renamed and one unneed argument was removed.
% \begin{macrocode}
+%<*deprecated>
\cs_new_protected:Npn \iow_wrap:xnnnN #1#2#3#4#5
{ \iow_wrap:nnnN {#1} {#2} {#4} #5 }
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1819,7 +1697,9 @@
% \begin{variable}{\l_iow_line_length_int}
% Simple rename. Here we copy the \TeX{} register.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \l_iow_line_length_int \l_iow_line_count_int
+%</deprecated>
% \end{macrocode}
% \end{variable}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3format.ins b/Master/texmf-dist/source/latex/l3kernel/l3format.ins
new file mode 100644
index 00000000000..76fe0ee3e76
--- /dev/null
+++ b/Master/texmf-dist/source/latex/l3kernel/l3format.ins
@@ -0,0 +1,92 @@
+\iffalse meta-comment
+
+File l3format.ins Copyright (C) 2011,2012 The 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 "l3kernel 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.
+
+\fi
+
+\let\jobname\relax
+\input l3docstrip.dtx
+\askforoverwritefalse
+
+\preamble
+
+EXPERIMENTAL CODE
+
+Do not distribute this file without also distributing the
+source files specified above.
+
+Do not distribute a modified version of this file.
+
+\endpreamble
+% stop docstrip adding \endinput
+\postamble
+\endpostamble
+
+\keepsilent
+
+\generate
+ {
+ \file{l3format.ltx}
+ {
+ \from{l3bootstrap.dtx} {initex}
+ \from{l3names.dtx} {initex}
+ \from{l3basics.dtx} {initex}
+ \from{l3expan.dtx} {initex}
+ \from{l3tl.dtx} {initex}
+ \from{l3seq.dtx} {initex}
+ % ===== ===FORMAT ONLY =========
+ \from{l3alloc.dtx} {initex}
+ % ==============================
+ \from{l3int.dtx} {initex}
+ \from{l3quark.dtx} {initex}
+ \from{l3prg.dtx} {initex}
+ \from{l3clist.dtx} {initex}
+ \from{l3token.dtx} {initex}
+ \from{l3prop.dtx} {initex}
+ \from{l3msg.dtx} {initex}
+ \from{l3file.dtx} {initex}
+ \from{l3skip.dtx} {initex}
+ \from{l3keys.dtx} {initex}
+ \from{l3fp.dtx} {initex}
+ \from{l3fp-aux.dtx} {initex}
+ \from{l3fp-traps.dtx} {initex}
+ \from{l3fp-round.dtx} {initex}
+ \from{l3fp-parse.dtx} {initex}
+ \from{l3fp-logic.dtx} {initex}
+ \from{l3fp-basics.dtx} {initex}
+ \from{l3fp-extended.dtx}{initex}
+ \from{l3fp-expo.dtx} {initex}
+ \from{l3fp-trig.dtx} {initex}
+ \from{l3fp-convert.dtx} {initex}
+ \from{l3fp-assign.dtx} {initex}
+ \from{l3fp-old.dtx} {initex}
+ \from{l3box.dtx} {initex}
+ \from{l3coffins.dtx} {initex}
+ \from{l3color.dtx} {initex}
+ \from{l3luatex.dtx} {initex}
+ \from{l3candidates.dtx} {initex}
+ % ======== FORMAT ONLY =========
+ \from{l3final.dtx} {initex}
+ % ==============================
+ }
+ }
+
+\generate{\file{l3dvips.ltx} {\from{l3drivers.dtx}{initex,dvips} }}
+\generate{\file{l3pdfmode.ltx} {\from{l3drivers.dtx}{initex,pdfmode} }}
+\generate{\file{l3xdvipdfmx.ltx}{\from{l3drivers.dtx}{initex,xdvipdfmx}}}
+
+\generate{\file{l3docstrip.tex}{\from{l3docstrip.dtx}{program}}}
+
+\endbatchfile \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
index edbe34ee82c..6c7991c4027 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
@@ -96,14 +96,8 @@
% \begin{macro}[pTF]{\fp_if_exist:N, \fp_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \fp_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \fp_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \fp_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \fp_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \fp_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \fp_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \fp_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \fp_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \fp_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \fp_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
index ceb2840a810..1e00baa38da 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
@@ -36,7 +36,7 @@
%
%<*driver>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-traps.dtx 4179 2012-08-31 15:54:18Z bruno $
+\GetIdInfo$Id: l3fp-traps.dtx 4428 2013-01-10 13:23:29Z bruno $
{L3 Floating-point exception trapping}
\documentclass[full]{l3doc}
\begin{document}
@@ -91,7 +91,7 @@
% Function to turn a flag off. Simply undefine it.
% \begin{macrocode}
\cs_new_protected:Npn \fp_flag_off:n #1
- { \cs_set_eq:cN { l_@@_ #1 _flag_token } \c_undefined:D }
+ { \cs_set_eq:cN { l_@@_ #1 _flag_token } \tex_undefined:D }
% \end{macrocode}
% \end{macro}
%
@@ -128,10 +128,10 @@
% The \textsc{ieee} standard defines five exceptions. We currently
% don't support the \enquote{inexact} exception.
% \begin{macrocode}
-\cs_new_eq:NN \l_@@_invalid_operation_flag_token \c_undefined:D
-\cs_new_eq:NN \l_@@_division_by_zero_flag_token \c_undefined:D
-\cs_new_eq:NN \l_@@_overflow_flag_token \c_undefined:D
-\cs_new_eq:NN \l_@@_underflow_flag_token \c_undefined:D
+\cs_new_eq:NN \l_@@_invalid_operation_flag_token \tex_undefined:D
+\cs_new_eq:NN \l_@@_division_by_zero_flag_token \tex_undefined:D
+\cs_new_eq:NN \l_@@_overflow_flag_token \tex_undefined:D
+\cs_new_eq:NN \l_@@_underflow_flag_token \tex_undefined:D
% \end{macrocode}
% \end{variable}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
index e531e62e54e..09efdfdd58f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
@@ -36,7 +36,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp.dtx 4305 2012-11-10 08:40:25Z joseph $
+\GetIdInfo$Id: l3fp.dtx 4449 2013-01-19 23:55:05Z bruno $
{L3 Floating points}
%</driver|package>
%<*driver>
@@ -362,16 +362,18 @@
% case occurs exactly when one of the operands is \nan{}, and
% this relations is denoted by the symbol |?|. The \texttt{nNn}
% functions support the \meta{relations} |<|, |=|, |>|, and |?|. The
-% \texttt{n} functions support as a \meta{relation} any combination of
-% those four symbols, plus an optional leading |!| (which negates the
+% \texttt{n} functions support as a \meta{relation} any non-empty string of
+% those four symbols, plus optional leading |!| (which negate the
% \meta{relation}), with the restriction that the \meta{relation} may
% not start with |?|. Common choices of \meta{relation} include |>=|
% (greater or equal), |!=| (not equal), |!?| (comparable). Note that
% a \nan{} is distinct from any value, even another
-% \nan{}, hence $x=x$ is not true for a \nan{}. Thus to
-% test if a value is \nan{}, use
+% \nan{}, hence $x=x$ is not true for a \nan{}.
+% Since a \nan{} is not comparable to any floating point, to test if a
+% value is \nan{}, one can use the following, where~$0$ is an
+% arbitrary floating point.
% \begin{verbatim}
-% \fp_compare:nNnTF { <value> } != { <value> }
+% \fp_compare:nNnTF { <value> } ? { 0 }
% { } % <value> is nan
% { } % <value> is not nan
% \end{verbatim}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
index e67616a2f7d..dcea709ebbc 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3int.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3int.dtx Copyright (C) 1990-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3int.dtx 4237 2012-09-26 10:18:58Z bruno $
+\GetIdInfo$Id: l3int.dtx 4444 2013-01-13 20:27:20Z bruno $
{L3 Integers}
%</driver|package>
%<*driver>
@@ -300,16 +300,36 @@
% \end{center}
% \end{function}
%
-% \begin{function}[EXP,pTF]{\int_compare:n}
+% \begin{function}[updated = 2013-01-13, EXP, pTF]{\int_compare:n}
% \begin{syntax}
-% \cs{int_compare_p:n} \{ \meta{intexpr_1} \meta{relation} \meta{intexpr_2} \} \\
+% \cs{int_compare_p:n} \\
+% ~~\{ \\
+% ~~~~\meta{intexpr_1} \meta{relation_1} \\
+% ~~~~\ldots{} \\
+% ~~~~\meta{intexpr_N} \meta{relation_N} \\
+% ~~~~\meta{intexpr_{N+1}} \\
+% ~~\} \\
% \cs{int_compare:nTF}
-% ~~\{ \meta{intexpr_1} \meta{relation} \meta{intexpr_2} \}
+% ~~\{ \\
+% ~~~~\meta{intexpr_1} \meta{relation_1} \\
+% ~~~~\ldots{} \\
+% ~~~~\meta{intexpr_N} \meta{relation_N} \\
+% ~~~~\meta{intexpr_{N+1}} \\
+% ~~\} \\
% ~~\Arg{true code} \Arg{false code}
% \end{syntax}
-% This function first evaluates each of the \meta{integer expressions}
-% as described for \cs{int_eval:n}. The two results are then
-% compared using the \meta{relation}:
+% This function evaluates the \meta{integer expressions} as described
+% for \cs{int_eval:n} and compares consecutive result using the
+% corresponding \meta{relation}, namely it compares \meta{intexpr_1}
+% and \meta{intexpr_2} using the \meta{relation_1}, then
+% \meta{intexpr_2} and \meta{intexpr_3} using the \meta{relation_2},
+% until finally comparing \meta{intexpr_N} and \meta{intexpr_{N+1}}
+% using the \meta{relation_N}. The test yields \texttt{true} if all
+% comparisons are \texttt{true}. Each \meta{integer expression} is
+% evaluated only once, and the evaluation is lazy, in the sense that
+% if one comparison is \texttt{false}, then no other \meta{integer
+% expression} is evaluated and no other comparison is performed.
+% The \meta{relations} can be any of the following:
% \begin{center}
% \begin{tabular}{ll}
% Equal & |=| or |==| \\
@@ -413,35 +433,35 @@
% \texttt{false}.
% \end{function}
%
-% \begin{function}[rEXP]{\int_do_until:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\int_do_until:nn}
% \begin{syntax}
-% \cs{int_do_until:nn} \{ \meta{intexpr_1} \meta{relation} \meta{intexpr_2} \} \Arg{code}
+% \cs{int_do_until:nn} \Arg{integer relation} \Arg{code}
% \end{syntax}
% Places the \meta{code} in the input stream for \TeX{} to process, and
-% then evaluates the relationship between the two
-% \meta{integer expressions} as described for \cs{int_compare:nTF}.
+% then evaluates the \meta{integer relation}
+% as described for \cs{int_compare:nTF}.
% If the test is \texttt{false} then the \meta{code} will be inserted
% into the input stream again and a loop will occur until the
% \meta{relation} is \texttt{true}.
% \end{function}
%
-% \begin{function}[rEXP]{\int_do_while:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\int_do_while:nn}
% \begin{syntax}
-% \cs{int_do_while:nn} \{ \meta{intexpr_1} \meta{relation} \meta{intexpr_2} \} \Arg{code}
+% \cs{int_do_while:nn} \Arg{integer relation} \Arg{code}
% \end{syntax}
% Places the \meta{code} in the input stream for \TeX{} to process, and
-% then evaluates the relationship between the two
-% \meta{integer expressions} as described for \cs{int_compare:nTF}.
+% then evaluates the \meta{integer relation}
+% as described for \cs{int_compare:nTF}.
% If the test is \texttt{true} then the \meta{code} will be inserted
% into the input stream again and a loop will occur until the
% \meta{relation} is \texttt{false}.
% \end{function}
%
-% \begin{function}[rEXP]{\int_until_do:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\int_until_do:nn}
% \begin{syntax}
-% \cs{int_until_do:nn} \{ \meta{intexpr_1} \meta{relation} \meta{intexpr_2} \} \Arg{code}
+% \cs{int_until_do:nn} \Arg{integer_relation} \Arg{code}
% \end{syntax}
-% Evaluates the relationship between the two \meta{integer expressions}
+% Evaluates the \meta{integer relation}
% as described for \cs{int_compare:nTF}, and then places the
% \meta{code} in the input stream if the \meta{relation} is
% \texttt{false}. After the \meta{code} has been processed by \TeX{} the
@@ -449,11 +469,11 @@
% \texttt{true}.
% \end{function}
%
-% \begin{function}[rEXP]{\int_while_do:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\int_while_do:nn}
% \begin{syntax}
-% \cs{int_while_do:nn} \{ \meta{intexpr_1} \meta{relation} \meta{intexpr_2} \} \Arg{code}
+% \cs{int_while_do:nn} \Arg{integer relation} \Arg{code}
% \end{syntax}
-% Evaluates the relationship between the two \meta{integer expressions}
+% Evaluates the \meta{integer relation}
% as described for \cs{int_compare:nTF}, and then places the
% \meta{code} in the input stream if the \meta{relation} is
% \texttt{true}. After the \meta{code} has been processed by \TeX{} the
@@ -591,7 +611,7 @@
%
% \begin{function}[updated = 2011-09-17, EXP]{\int_to_hexadecimal:n}
% \begin{syntax}
-% \cs{int_to_binary:n} \Arg{integer expression}
+% \cs{int_to_hexadecimal:n} \Arg{integer expression}
% \end{syntax}
% Calculates the value of the \meta{integer expression} and places
% the hexadecimal (base~$16$) representation of the result in the
@@ -1167,14 +1187,8 @@
% \begin{macro}[pTF]{\int_if_exist:N, \int_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \int_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \int_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \int_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \int_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \int_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \int_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \int_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \int_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \int_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \int_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1288,8 +1302,10 @@
\__prg_compare_error:
}
\cs_new:Npn \__prg_compare_error:Nw
- #1#2 \prg_return_true: \else: \prg_return_false: \fi:
+ #1#2 \q_stop
{
+ { }
+ \c_zero \fi:
\__msg_kernel_expandable_error:nnn
{ kernel } { unknown-comparison } {#1}
\prg_return_false:
@@ -1298,9 +1314,11 @@
% \end{macro}
%
% \begin{macro}[pTF, EXP]{\int_compare:n}
-% \begin{macro}[aux, EXP]{\@@_compare_aux:Nw, \@@_compare_aux:NNw}
+% \begin{macro}[aux, EXP]
+% {\@@_compare:w, \@@_compare:Nw, \@@_compare:NNw, \@@_compare:nnN}
% \begin{macro}[aux, EXP]
% {
+% \@@_compare_end_=:NNw,
% \@@_compare_=:NNw,
% \@@_compare_<:NNw,
% \@@_compare_>:NNw,
@@ -1310,67 +1328,122 @@
% \@@_compare_>=:NNw
% }
% Comparison tests using a simple syntax where only one set of braces
-% is required and additional operators such as |!=| and |>=| are
-% supported. We can start evaluating from the left using
-% \cs{@@_eval:w}, and we know that since the relation symbols |<|,
-% |>|, |=| and |!| are not allowed in such expressions, they will
-% terminate the expression. Therefore, we first let \TeX{} evaluate
-% this left hand side of the (in)equality. We also insert at that
-% stage the end of the test: \cs{@@_eval_end:} will end the
-% evaluation of the right-hand side.
+% is required, additional operators such as |!=| and |>=| are
+% supported, and multiple comparisons can be performed at once, for
+% instance |0 < 5 <= 1|. The idea is to loop through the argument,
+% finding one operand at a time, and comparing it to the previous one.
+% The looping auxiliary \cs{@@_compare:Nw} reads one \meta{operand}
+% and one \meta{comparison} symbol, and leaves roughly
+% \begin{quote}
+% \meta{operand} \cs{prg_return_false:} \cs{fi:} \\
+% \cs{reverse_if:N} \cs{if_int_compare:w} \meta{operand} \meta{comparison} \\
+% \cs{@@_compare:Nw}
+% \end{quote}
+% in the input stream. Each call to this auxiliary provides the
+% second operand of the last call's \cs{if_int_compare:w}. If one of
+% the \meta{comparisons} is \texttt{false}, the \texttt{true} branch
+% of the \TeX{} conditional is taken (because of \cs{reverse_if:N}),
+% immediately returning \texttt{false} as the result of the test.
+% There is no \TeX{} conditional waiting the first operand, so we add
+% an \cs{if_false:} and expand by hand with \cs{@@_value:w}, thus
+% skipping \cs{prg_return_false:} on the first iteration.
+%
+% Before starting the loop, the first step is to make sure that there
+% is at least one relation symbol. We first let \TeX{} evaluate this
+% left hand side of the (in)equality using \cs{@@_eval:w}. Since the
+% relation symbols |<|, |>|, |=| and |!| are not allowed in integer
+% expressions, they will terminate it. If the argument contains no
+% relation symbol, \cs{__prg_compare_error:} is expanded,
+% inserting~|=| and itself after an error. In all cases,
+% \cs{@@_compare:w} receives as its argument an integer, a relation
+% symbol, and some more tokens. We then setup the loop, which will be
+% ended by the two odd-looking items |e| and |{=nd_}|, with a trailing
+% \cs{q_stop} used to grab the entire argument when necessary.
% \begin{macrocode}
\prg_new_conditional:Npnn \int_compare:n #1 { p , T , F , TF }
{
- \exp_after:wN \@@_compare_aux:Nw \int_use:N \@@_eval:w #1
- \__prg_compare_error: \@@_eval_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
+ \exp_after:wN \@@_compare:w
+ \int_use:N \@@_eval:w #1 \__prg_compare_error:
+ }
+\cs_new:Npn \@@_compare:w #1 \__prg_compare_error:
+ {
+ \exp_after:wN \if_false: \@@_value:w
+ \@@_compare:Nw #1 e { = nd_ } \q_stop
}
% \end{macrocode}
-% We have just evaluated the left-hand side. To access the relation
-% symbol, we remove the number by applying \cs{@@_to_roman:w}, after
-% making sure that the argument becomes non-positive: its roman
-% numeral representation is then empty. The \cs{@@_compare_aux:NNw}
-% auxiliary then probes the first two tokens to determine the relation
-% symbol, building a control sequence from it. All the extended forms
-% have an extra |=| hence the test for that as a second token. If the
-% relation symbol is unknown, then the control sequence is turned by
-% \TeX{} into \cs{scan_stop:}, and \cs{__prg_compare_error:Nw}
-% raises an error.
+% The goal here is to find an \meta{operand} and a \meta{comparison}.
+% The \meta{operand} is already evaluated, but we cannot yet grab it
+% as an argument. To access the following relation symbol, we remove
+% the number by applying \cs{@@_to_roman:w}, after making sure that
+% the argument becomes non-positive: its roman numeral representation
+% is then empty. Then probe the first two tokens with
+% \cs{@@_compare:NNw} to determine the relation symbol, building a
+% control sequence from it. All the extended forms have an extra |=|
+% hence the test for that as a second token. If the relation symbol
+% is unknown, then the control sequence is turned by \TeX{} into
+% \cs{scan_stop:}, ignored thanks to \tn{unexpanded}, and
+% \cs{__prg_compare_error:Nw} raises an error.
% \begin{macrocode}
-\cs_new:Npn \@@_compare_aux:Nw #1#2 \__prg_compare_error:
+\cs_new:Npn \@@_compare:Nw #1#2 \q_stop
{
- \exp_after:wN \@@_compare_aux:NNw
- \@@_to_roman:w - 0 #2 ?? \q_mark
- #1#2
+ \exp_after:wN \@@_compare:NNw
+ \@@_to_roman:w - 0 #2 \q_mark
+ #1#2 \q_stop
}
-\cs_new:Npn \@@_compare_aux:NNw #1#2#3 \q_mark
+\cs_new:Npn \@@_compare:NNw #1#2#3 \q_mark
{
+ \etex_unexpanded:D
\use:c { @@_compare_ #1 \if_meaning:w = #2 = \fi: :NNw }
\__prg_compare_error:Nw #1
}
% \end{macrocode}
+% When the last \meta{operand} is seen, \cs{@@_compare:NNw} receives
+% |e| and |=nd_| as arguments, hence calling
+% \cs{@@_compare_end_=:NNw} to end the loop: return the result of the
+% last comparison (involving the operand that we just found). When a
+% normal relation is found, the appropriate auxiliary calls
+% \cs{@@_compare:nnN} where |#1| is \cs{if_int_compare:w} or
+% \cs{reverse_if:N} \cs{if_int_compare:w}, |#2| is the \meta{operand},
+% and |#3| is one of |<|, |=|, or~|>|. As announced earlier, we leave
+% the \meta{operand} for the previous conditional. If this
+% conditional is true the result of the test is known, so we remove
+% all tokens and return \texttt{false}. Otherwise, we apply the
+% conditional |#1| to the \meta{operand} |#2| and the comparison |#3|,
+% and call \cs{@@_compare:Nw} to look for additional operands, after
+% evaluating the following expression.
+% \begin{macrocode}
+\cs_new:cpn { @@_compare_end_=:NNw } #1#2#3 e #4 \q_stop
+ {
+ {#3} \exp_stop_f:
+ \prg_return_false: \else: \prg_return_true: \fi:
+ }
+\cs_new:Npn \@@_compare:nnN #1#2#3
+ {
+ {#2} \exp_stop_f:
+ \prg_return_false: \exp_after:wN \use_none_delimit_by_q_stop:w
+ \fi:
+ #1 #2 #3 \exp_after:wN \@@_compare:Nw \@@_value:w \@@_eval:w
+ }
+% \end{macrocode}
% The actual comparisons are then simple function calls, using the
% relation as delimiter for a delimited argument and discarding
% \cs{__prg_compare_error:Nw} \meta{token} responsible for error
% detection.
% \begin{macrocode}
\cs_new:cpn { @@_compare_=:NNw } #1#2#3 =
- { \if_int_compare:w #3 = \@@_eval:w }
+ { \@@_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} = }
\cs_new:cpn { @@_compare_<:NNw } #1#2#3 <
- { \if_int_compare:w #3 < \@@_eval:w }
+ { \@@_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} < }
\cs_new:cpn { @@_compare_>:NNw } #1#2#3 >
- { \if_int_compare:w #3 > \@@_eval:w }
+ { \@@_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} > }
\cs_new:cpn { @@_compare_==:NNw } #1#2#3 ==
- { \if_int_compare:w #3 = \@@_eval:w }
+ { \@@_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} = }
\cs_new:cpn { @@_compare_!=:NNw } #1#2#3 !=
- { \reverse_if:N \if_int_compare:w #3 = \@@_eval:w }
+ { \@@_compare:nnN { \if_int_compare:w } {#3} = }
\cs_new:cpn { @@_compare_<=:NNw } #1#2#3 <=
- { \reverse_if:N \if_int_compare:w #3 > \@@_eval:w }
+ { \@@_compare:nnN { \if_int_compare:w } {#3} > }
\cs_new:cpn { @@_compare_>=:NNw } #1#2#3 >=
- { \reverse_if:N \if_int_compare:w #3 < \@@_eval:w }
+ { \@@_compare:nnN { \if_int_compare:w } {#3} < }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2335,29 +2408,37 @@
% \begin{macro}{\if_num:w}
% Deprecated 2012-05-30 for removal after 2012-11-30.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \if_num:w \if_int_compare:w
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
% \begin{variable}{\l_tmpc_int}
% Deprecated 2012-07-04 for removal after 2012-12-31.
% \begin{macrocode}
+%<*deprecated>
\int_new:N \l_tmpc_int
+%</deprecated>
% \end{macrocode}
% \end{variable}
%
% \begin{macro}{\int_eval:w, \int_eval_end:}
% Deprecated 2012-07-13 for removal after 2012-12-31.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \int_eval:w \@@_eval:w
\cs_new_eq:NN \int_eval_end: \@@_eval_end:
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\int_value:w}
% Deprecated 2012-07-14 for removal after 2012-12-31.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \int_value:w \@@_value:w
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index b6a4cafb577..3d38853224a 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3keys.dtx Copyright (C) 2006-2012 The LaTeX3 Project
+%% File: l3keys.dtx Copyright (C) 2006-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3keys.dtx 4256 2012-11-02 08:47:41Z joseph $
+\GetIdInfo$Id: l3keys.dtx 4461 2013-02-24 18:55:17Z joseph $
{L3 Experimental key-value interfaces}
%</driver|package>
%<*driver>
@@ -863,8 +863,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_split_key:n #1
{
- \str_if_eq_x:nnTF
- { \exp_not:N \q_nil } { \exp_not:o { \use_none:nnn #1 \q_nil \q_nil } }
+ \quark_if_nil:oTF { \use_none:nnn #1 \q_nil \q_nil }
{ \tl_set:Nx \l_@@_key_tl { \exp_not:o { \use_ii:nnn #1 \q_nil } } }
{ \@@_split_key:w #1 \q_stop }
}
@@ -1977,7 +1976,9 @@
% Internal material for removal by 2012-12-31.
%
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \c_keys_code_root_tl \c__keys_code_root_tl
+%</deprecated>
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index 3d72db5db51..9a10e278f2d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3msg.dtx Copyright (C) 2009-2012 The LaTeX3 Project
+%% File: l3msg.dtx Copyright (C) 2009-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3msg.dtx 4212 2012-09-09 12:24:04Z bruno $
+\GetIdInfo$Id: l3msg.dtx 4412 2013-01-08 12:23:19Z joseph $
{L3 Messages}
%</driver|package>
%<*driver>
@@ -2206,8 +2206,10 @@
% \begin{macro}{\msg_newline:, \msg_two_newlines:}
% New lines are printed in the same way as for low-level file writing.
% \begin{macrocode}
+%<*deprecated>
\cs_new_nopar:Npn \msg_newline: { ^^J }
\cs_new_nopar:Npn \msg_two_newlines: { ^^J ^^J }
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -2215,9 +2217,11 @@
% \begin{macro}{\msg_interrupt:xxx}
% These were all misnamed.
% \begin{macrocode}
+%<*deprecated>
\cs_generate_variant:Nn \msg_log:n { x }
\cs_generate_variant:Nn \msg_term:n { x }
\cs_generate_variant:Nn \msg_interrupt:nnn { xxx }
+%</deprecated>
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2229,6 +2233,7 @@
% is cleared, and the various message functions are created
% to simply use the code stored for the message.
% \begin{macrocode}
+%<*deprecated>
\cs_new_protected:Npn \msg_class_set:nn #1#2
{
\cs_if_exist:cTF { @@_ #1 _code:nnnnnn }
@@ -2247,6 +2252,7 @@
\cs_set_protected:cpx { msg_ #1 :nn } ##1##2
{ \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} { } { } { } { } }
}
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index 54db54f0f58..79fa7961ebd 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3prg.dtx Copyright (C) 2005-2012 The LaTeX3 Project
+%% File: l3prg.dtx Copyright (C) 2005-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prg.dtx 4339 2012-11-24 19:16:43Z joseph $
+\GetIdInfo$Id: l3prg.dtx 4459 2013-02-13 09:21:15Z will $
{L3 Control structures}
%</driver|package>
%<*driver>
@@ -183,8 +183,8 @@
% |\foo_if_bar:NNT| but not |\foo_if_bar:NNF| (because |F| is missing
% from the \meta{conditions} list). The return statements take care of
% resolving the remaining \cs{else:} and \cs{fi:} before returning the
-% state. There must be a return statement for each branch, failing to do
-% so will result in an error if that branch is executed.
+% state. There must be a return statement for each branch; failing to do
+% so will result in erroneous output if that branch is executed.
%
% \begin{function}{\prg_new_eq_conditional:NNn, \prg_set_eq_conditional:NNn}
% \begin{syntax}
@@ -203,9 +203,18 @@
% \cs{prg_return_true:}
% \cs{prg_return_false:}
% \end{syntax}
-% These functions define the logical state at the end of a conditional.
-% As such, they should appear within the code for a conditional
-% statement generated by \cs{prg_set_conditional:Npnn}, \emph{etc}.
+% These `return' functions define the logical state of a conditional statement.
+% They appear within the code for a conditional
+% function generated by \cs{prg_set_conditional:Npnn}, \emph{etc}, to indicate
+% when a true or false branch has been taken.
+% While they may appear multiple times each within the code of such conditionals,
+% the execution of the conditional must result in the expansion of one of these
+% two functions \emph{exactly once}.
+%
+% The return functions trigger what is internally an f-expansion process to complete
+% the evaluation of the conditional. Therefore, after \cs{prg_return_true:} or \cs{prg_return_false:}
+% there must be no non-expandable material in the input stream for the remainder of
+% the expansion of the conditional code. This includes other instances of either of these functions.
% \end{function}
%
% \section{The boolean data type}
@@ -870,14 +879,8 @@
% \begin{macro}[pTF]{\bool_if_exist:N, \bool_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \bool_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \bool_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \bool_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \bool_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \bool_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \bool_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \bool_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \bool_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \bool_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \bool_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1817,12 +1820,14 @@
% }
% Moved to more sensible modules.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \prg_case_int:nnn \int_case:nnn
\cs_new_eq:NN \prg_case_str:nnn \str_case:nnn
\cs_new_eq:NN \prg_case_str:onn \str_case:onn
\cs_new_eq:NN \prg_case_str:xxn \str_case_x:nnn
\cs_new_eq:NN \prg_case_tl:Nnn \tl_case:Nnn
\cs_new_eq:NN \prg_case_tl:cnn \tl_case:cnn
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1834,9 +1839,11 @@
% \prg_stepwise_variable:nnnNn
% }
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \prg_stepwise_function:nnnN \int_step_function:nnnN
\cs_new_eq:NN \prg_stepwise_inline:nnnn \int_step_inline:nnnn
\cs_new_eq:NN \prg_stepwise_variable:nnnNn \int_step_variable:nnnNn
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index d8bec5ee50d..3046ae59e8b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3prop.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3prop.dtx Copyright (C) 1990-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prop.dtx 4212 2012-09-09 12:24:04Z bruno $
+\GetIdInfo$Id: l3prop.dtx 4423 2013-01-09 00:05:30Z bruno $
{L3 Property lists}
%</driver|package>
%<*driver>
@@ -245,7 +245,7 @@
% check that the \meta{property list} really is a property list variable.
% \end{function}
%
-% \begin{function}[EXP,pTF]{\prop_if_empty:N, \prop_if_empty:c}
+% \begin{function}[EXP, pTF]{\prop_if_empty:N, \prop_if_empty:c}
% \begin{syntax}
% \cs{prop_if_empty_p:N} \meta{property list}
% \cs{prop_if_empty:NTF} \meta{property list} \Arg{true code} \Arg{false code}
@@ -331,7 +331,7 @@
%
% \section{Mapping to property lists}
%
-% \begin{function}[updated = 2012-06-29, rEXP]
+% \begin{function}[updated = 2013-01-08, rEXP]
% {\prop_map_function:NN, \prop_map_function:cN}
% \begin{syntax}
% \cs{prop_map_function:NN} \meta{property list} \meta{function}
@@ -343,7 +343,7 @@
% should not be relied upon.
% \end{function}
%
-% \begin{function}[updated = 2012-06-29]
+% \begin{function}[updated = 2013-01-08]
% {\prop_map_inline:Nn, \prop_map_inline:cn}
% \begin{syntax}
% \cs{prop_map_inline:Nn} \meta{property list} \Arg{inline function}
@@ -432,29 +432,39 @@
%
% \section{Internal property list functions}
%
-% \begin{variable}{\q__prop}
-% The internal token used to separate out property list entries, separating
-% both the \meta{key} from the \meta{value} and also one entry from another.
+% \begin{variable}{\s__prop}
+% The internal token used to separate out property list entries,
+% surrounding each \meta{key}.
% \end{variable}
%
-% \begin{function}{\__prop_split:NnTF}
+% \begin{variable}{\l__prop_internal_tl}
+% Token list used to store new key--value pairs to be inserted by
+% functions of the \cs{prop_put:Nnn} family.
+% \end{variable}
+%
+% \begin{function}[updated = 2013-01-08]{\__prop_split:NnTF}
% \begin{syntax}
% \cs{__prop_split:NnTF} \meta{property list} \Arg{key} \Arg{true code} \Arg{false code}
% \end{syntax}
% Splits the \meta{property list} at the \meta{key}, giving three
-% groups: the \meta{extract} of \meta{property list} before the
+% token lists: the \meta{extract} of \meta{property list} before the
% \meta{key}, the \meta{value} associated with the \meta{key} and the
% \meta{extract} of the \meta{property list} after the \meta{value}.
-% The first \meta{extract} retains the internal structure of a property
-% list. The second is only missing the leading separator \cs{q__prop}.
-% This ensures that the concatenation of the two \meta{extracts} is a
+% Both \meta{extracts} retain the internal structure of a property
+% list, and the concatenation of the two \meta{extracts} is a
% property list.
% If the \meta{key} is present in the \meta{property list} then the
-% \meta{true code} is left in the input stream, followed by the three
-% groups: thus the \meta{true code} should properly absorb three arguments.
+% \meta{true code} is left in the input stream, with |#1|, |#2|, and
+% |#3| replaced by the first \meta{extract}, the \meta{value}, and the
+% second extract.
% If the \meta{key} is not present in the \meta{property list} then
% the \meta{false code} is left in the input stream, with no trailing
% material.
+% Both \meta{true code} and \meta{false code} are used in the
+% replacement text of a macro defined internally, hence macro
+% parameter characters should be doubled, except |#1|, |#2|, and |#3|
+% which stand in the \meta{true code} for the three extracts from the
+% property list.
% The \meta{key} comparison takes place as described for \cs{str_if_eq:nn}.
% \end{function}
%
@@ -484,47 +494,51 @@
%
% A property list is a macro whose top-level expansion is for the form
% \begin{quote}
-% \cs{q_@@} \meta{key_1} \cs{q_@@} \Arg{value_1} \\
+% \cs{s_@@} \meta{key_1} \cs{s_@@} \Arg{value_1} \\
% \ldots{} \\
-% \cs{q_@@} \meta{key_n} \cs{q_@@} \Arg{value_n} \\
-% \cs{q_@@}
+% \cs{s_@@} \meta{key_n} \cs{s_@@} \Arg{value_n} \\
% \end{quote}
-% where the trailing \cs{q_@@} is always present for performance
-% reasons: this means that empty property lists are not actually empty.
%
-% \begin{macro}[int]{\q_@@}
-% A private quark is used as a marker between entries.
+% \begin{macro}[int]{\s_@@}
+% A private scan mark is used as a marker surrounding each key.
% \begin{macrocode}
-\quark_new:N \q_@@
+\__scan_new:N \s_@@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\l_@@_internal_tl}
+% Token list used to store the new key--value pair inserted by
+% \cs{prop_put:Nnn} and friends.
+% \begin{macrocode}
+\tl_new:N \l_@@_internal_tl
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}[tested = m3prop004]{\c_empty_prop}
-% An empty prop contains exactly one \cs{q_@@}.
+% An empty prop is an empty token list.
% \begin{macrocode}
-\tl_const:Nn \c_empty_prop { \q_@@ }
+\cs_new_eq:NN \c_empty_prop \c_empty_tl
% \end{macrocode}
% \end{variable}
%
% \subsection{Allocation and initialisation}
%
-% \begin{macro}[tested = m3prop001]{\prop_new:N,\prop_new:c}
-% Internally, property lists are token lists, but an empty prop
-% is not an empty tl, so we need to do things by hand.
+% \begin{macro}[tested = m3prop001]{\prop_new:N, \prop_new:c}
+% Internally, property lists are just token lists.
% \begin{macrocode}
-\cs_new_protected:Npn \prop_new:N #1 { \cs_new_eq:NN #1 \c_empty_prop }
-\cs_new_protected:Npn \prop_new:c #1 { \cs_new_eq:cN {#1} \c_empty_prop }
+\cs_new_eq:NN \prop_new:N \tl_new:N
+\cs_new_eq:NN \prop_new:c \tl_new:c
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[tested = m3prop001]{\prop_clear:N, \prop_clear:c}
% \begin{macro}[tested = m3prop001]{\prop_gclear:N, \prop_gclear:c}
-% The same idea for clearing
+% The same idea for clearing.
% \begin{macrocode}
-\cs_new_protected:Npn \prop_clear:N #1 { \cs_set_eq:NN #1 \c_empty_prop }
-\cs_generate_variant:Nn \prop_clear:N { c }
-\cs_new_protected:Npn \prop_gclear:N #1 { \cs_gset_eq:NN #1 \c_empty_prop }
-\cs_generate_variant:Nn \prop_gclear:N { c }
+\cs_new_eq:NN \prop_clear:N \tl_clear:N
+\cs_new_eq:NN \prop_clear:c \tl_clear:c
+\cs_new_eq:NN \prop_gclear:N \tl_gclear:N
+\cs_new_eq:NN \prop_gclear:c \tl_gclear:c
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -533,12 +547,10 @@
% \begin{macro}[tested = m3prop001]{\prop_gclear_new:N, \prop_gclear_new:c}
% Once again a simple copy from the token list functions.
% \begin{macrocode}
-\cs_new_protected:Npn \prop_clear_new:N #1
- { \prop_if_exist:NTF #1 { \prop_clear:N #1 } { \prop_new:N #1 } }
-\cs_generate_variant:Nn \prop_clear_new:N { c }
-\cs_new_protected:Npn \prop_gclear_new:N #1
- { \prop_if_exist:NTF #1 { \prop_gclear:N #1 } { \prop_new:N #1 } }
-\cs_generate_variant:Nn \prop_gclear_new:N { c }
+\cs_new_eq:NN \prop_clear_new:N \tl_clear_new:N
+\cs_new_eq:NN \prop_clear_new:c \tl_clear_new:c
+\cs_new_eq:NN \prop_gclear_new:N \tl_gclear_new:N
+\cs_new_eq:NN \prop_gclear_new:c \tl_gclear_new:c
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -577,67 +589,69 @@
%
% \begin{macro}[int]{\@@_split:NnTF}
% \begin{macro}[aux]{\@@_split_aux:NnTF}
-% \begin{macro}[aux]{\@@_split_aux:nnnn}
-% \begin{macro}[aux]{\@@_split_aux:w}
+% \begin{macro}[aux, EXP]{\@@_split_aux:w}
% This function is used by most of the module, and hence must be fast.
-% The aim here is to split a property list at a given key into the part
-% before the key--value pair, the value associated with the key and the part
-% after the key--value pair. To do this, the key is first detokenized (to
-% avoid repeatedly doing this), then a delimited function is constructed to
-% match the key. It will match \cs{q_@@} \meta{detokenized key} \cs{q_@@}
-% \Arg{value} \meta{extra argument}, effectively separating an
-% \meta{extract_1} before the key in the property list and an \meta{extract_2}
-% after the key.
-%
-% If the key is present in the property list, then \meta{extra argument}
-% is simply \cs{q_@@}, and \cs{@@_split_aux:nnnn} will gobble this
-% and the false branch (|#4|), leaving the correct code on the input
-% stream. More precisely, it leaves the user code (true branch), followed
-% by three groups, \Arg{extract_1} \Arg{value} \Arg{extract_2}.
-% In order for \meta{extract_1}\meta{extract_2} to be a well-formed
-% property list, \meta{extract_1} has a leading and trailing \cs{q_@@},
-% retaining exactly the structure of a property list, while \meta{extract_2}
-% omits the leading \cs{q_@@}.
-%
-% If the key is not there, then \meta{extra argument} is |?|
-% \cs{use_ii:nn} |{ }|, and \cs{@@_split_aux:nnnn} |?| \cs{use_ii:nn}
-% |{ }| removes the three brace groups that just follow. Then
-% \cs{use_ii:nn} removes the true branch, leaving the false branch,
-% with no trailing material.
+% It receives a \meta{property list}, a \meta{key}, a \meta{true code}
+% and a \meta{false code}. The aim is to split the \meta{property
+% list} at the given \meta{key} into the \meta{extract_1} before the
+% key--value pair, the \meta{value} associated with the \meta{key} and
+% the \meta{extract_2} after the key--value pair. This is done using
+% a delimited function, whose definition is as follows, where the
+% \meta{key} is turned into a string.
+% \begin{quote}
+% \cs{cs_set:Npn} \cs{@@_split_aux:w} |#1| \\
+% \quad \cs{s_@@} \meta{key} \cs{s_@@} |#2| \\
+% \quad |#3| \cs{q_mark} |#4| |#5| \cs{q_stop} \\
+% \quad |{| |#4| \Arg{true code} \Arg{false code} |}|
+% \end{quote}
+%
+% If the \meta{key} is present in the property list,
+% \cs{@@_split_aux:w}'s |#1| is the part before the \meta{key}, |#2|
+% is the \meta{value}, |#3| is the part after the \meta{key}, |#4| is
+% \cs{use_i:nn}, and |#5| is additional tokens that we do not care
+% about. The \meta{true code} is left in the input stream, and can
+% use the parameters |#1|, |#2|, |#3| for the three parts of the
+% property list as desired.
+%
+% If the \meta{key} is not there, then the \meta{function} is
+% \cs{use_ii:nn}, which keeps the \meta{false code}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_split:NnTF #1#2
{ \exp_args:NNo \@@_split_aux:NnTF #1 { \tl_to_str:n {#2} } }
-\cs_new_protected:Npn \@@_split_aux:NnTF #1#2
+\cs_new_protected:Npn \@@_split_aux:NnTF #1#2#3#4
{
- \cs_set_protected:Npn \@@_split_aux:w
- ##1 \q_@@ #2 \q_@@ ##2 ##3 ##4 \q_mark ##5 \q_stop
- { \@@_split_aux:nnnn ##3 { {##1 \q_@@ } {##2} {##4} } }
- \exp_after:wN \@@_split_aux:w #1 \q_mark
- \q_@@ #2 \q_@@ { } { ? \use_ii:nn { } } \q_mark \q_stop
+ \cs_set:Npn \@@_split_aux:w ##1
+ \s_@@ #2 \s_@@ ##2 ##3 \q_mark ##4 ##5 \q_stop
+ { ##4 {#3} {#4} }
+ \exp_after:wN \@@_split_aux:w #1 \q_mark \use_i:nn
+ \s_@@ #2 \s_@@ { } \q_mark \use_ii:nn \q_stop
}
-\cs_new:Npn \@@_split_aux:nnnn #1#2#3#4 { #3 #2 }
-\cs_new_protected:Npn \@@_split_aux:w { }
+\cs_new:Npn \@@_split_aux:w { }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[tested = m3prop002]
% {\prop_remove:Nn, \prop_remove:NV, \prop_remove:cn, \prop_remove:cV}
% \begin{macro}[tested = m3prop002]
% {\prop_gremove:Nn, \prop_gremove:NV, \prop_gremove:cn, \prop_gremove:cV}
-% \begin{macro}[aux]{\@@_remove:NNnnn}
% Deleting from a property starts by splitting the list.
% If the key is present in the property list, the returned value is ignored.
% If the key is missing, nothing happens.
% \begin{macrocode}
\cs_new_protected:Npn \prop_remove:Nn #1#2
- { \@@_split:NnTF #1 {#2} { \@@_remove:NNnnn \tl_set:Nn #1 } { } }
+ {
+ \@@_split:NnTF #1 {#2}
+ { \tl_set:Nn #1 { ##1 ##3 } }
+ { }
+ }
\cs_new_protected:Npn \prop_gremove:Nn #1#2
- { \@@_split:NnTF #1 {#2} { \@@_remove:NNnnn \tl_gset:Nn #1 } { } }
-\cs_new_protected:Npn \@@_remove:NNnnn #1#2#3#4#5
- { #1 #2 { #3 #5 } }
+ {
+ \@@_split:NnTF #1 {#2}
+ { \tl_gset:Nn #1 { ##1 ##3 } }
+ { }
+ }
\cs_generate_variant:Nn \prop_remove:Nn { NV }
\cs_generate_variant:Nn \prop_remove:Nn { c , cV }
\cs_generate_variant:Nn \prop_gremove:Nn { NV }
@@ -645,14 +659,12 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[tested = m3prop002]
% {
% \prop_get:NnN, \prop_get:NVN, \prop_get:NoN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:coN
% }
-% \begin{macro}[aux]{\@@_get:Nnnn}
% Getting an item from a list is very easy: after splitting,
% if the key is in the property list, just set the token list variable
% to the return value, otherwise to \cs{q_no_value}.
@@ -660,22 +672,18 @@
\cs_new_protected:Npn \prop_get:NnN #1#2#3
{
\@@_split:NnTF #1 {#2}
- { \@@_get:Nnnn #3 }
+ { \tl_set:Nn #3 {##2} }
{ \tl_set:Nn #3 { \q_no_value } }
}
-\cs_new_protected:Npn \@@_get:Nnnn #1#2#3#4
- { \tl_set:Nn #1 {#3} }
\cs_generate_variant:Nn \prop_get:NnN { NV , No }
\cs_generate_variant:Nn \prop_get:NnN { c , cV , co }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[tested = m3prop002]
% {\prop_pop:NnN, \prop_pop:NoN, \prop_pop:cnN, \prop_pop:coN}
% \begin{macro}[tested = m3prop002]
% {\prop_gpop:NnN, \prop_gpop:NoN, \prop_gpop:cnN, \prop_gpop:coN}
-% \begin{macro}[aux]{\@@_pop:NNNnnn}
% Popping a value also starts by doing the split.
% If the key is present, save the value in the token list and update the
% property list as when deleting.
@@ -684,20 +692,21 @@
\cs_new_protected:Npn \prop_pop:NnN #1#2#3
{
\@@_split:NnTF #1 {#2}
- { \@@_pop:NNNnnn \tl_set:Nn #1 #3 }
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_set:Nn #1 { ##1 ##3 }
+ }
{ \tl_set:Nn #3 { \q_no_value } }
}
\cs_new_protected:Npn \prop_gpop:NnN #1#2#3
{
\@@_split:NnTF #1 {#2}
- { \@@_pop:NNNnnn \tl_gset:Nn #1 #3 }
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_gset:Nn #1 { ##1 ##3 }
+ }
{ \tl_set:Nn #3 { \q_no_value } }
}
-\cs_new_protected:Npn \@@_pop:NNNnnn #1#2#3#4#5#6
- {
- \tl_set:Nn #3 {#5}
- #1 #2 { #4 #6 }
- }
\cs_generate_variant:Nn \prop_pop:NnN { No }
\cs_generate_variant:Nn \prop_pop:NnN { c , co }
\cs_generate_variant:Nn \prop_gpop:NnN { No }
@@ -705,11 +714,9 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[TF, tested = m3prop004]
% {\prop_pop:NnN, \prop_pop:cnN, \prop_gpop:NnN, \prop_gpop:cnN}
-% \begin{macro}[aux]{\@@_pop_true:NNNnnn}
% Popping an item from a property list, keeping track of whether
% the key was present or not, is implemented as a conditional.
% If the key was missing, neither the property list, nor the token
@@ -719,21 +726,23 @@
\prg_new_protected_conditional:Npnn \prop_pop:NnN #1#2#3 { T , F , TF }
{
\@@_split:NnTF #1 {#2}
- { \@@_pop_true:NNNnnn \tl_set:Nn #1 #3 }
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_set:Nn #1 { ##1 ##3 }
+ \prg_return_true:
+ }
{ \prg_return_false: }
}
\prg_new_protected_conditional:Npnn \prop_gpop:NnN #1#2#3 { T , F , TF }
{
\@@_split:NnTF #1 {#2}
- { \@@_pop_true:NNNnnn \tl_gset:Nn #1 #3 }
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_gset:Nn #1 { ##1 ##3 }
+ \prg_return_true:
+ }
{ \prg_return_false: }
}
-\cs_new_protected:Npn \@@_pop_true:NNNnnn #1#2#3#4#5#6
- {
- \tl_set:Nn #3 {#5}
- #1 #2 { #4 #6 }
- \prg_return_true:
- }
\cs_generate_variant:Nn \prop_pop:NnNT { c }
\cs_generate_variant:Nn \prop_pop:NnNF { c }
\cs_generate_variant:Nn \prop_pop:NnNTF { c }
@@ -742,7 +751,6 @@
\cs_generate_variant:Nn \prop_gpop:NnNTF { c }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[tested = m3prop002]
% {
@@ -758,32 +766,31 @@
% \prop_gput:cnn, \prop_gput:cnV, \prop_gput:cno, \prop_gput:cnx,
% \prop_gput:cVn, \prop_gput:cVV, \prop_gput:con, \prop_gput:coo
% }
-% \begin{macro}[aux]{\@@_put:NNNnn, \@@_put:NNnnnnn}
-% Putting a key--value pair in a property list starts by splitting to
-% remove any existing value. If the \meta{key} was absent, append the
-% new key--value pair. Otherwise, the property list is reconstructed
-% from the two remaining parts |#5| and |#7|, and the updated entry.
-% The updated entry is placed at the same spot as the original
-% \meta{key} in the property list, preserving the order of entries.
+% \begin{macro}[aux]{\@@_put:NNNnn}
+% Since the branches of \cs{@@_split:NnTF} are used as the replacement
+% text of an internal macro, and since the \meta{key} and new
+% \meta{value} may contain arbitrary tokens, it is not safe to include
+% them in the argument of \cs{@@_split:NnTF}. We thus start by
+% storing in \cs{l_@@_internal_tl} tokens which (after
+% \texttt{x}-expansion) encode the key--value pair. This variable can
+% safely be used in \cs{@@_split:NnTF}. If the \meta{key} was absent,
+% append the new key--value to the list. Otherwise concatenate the
+% extracts |##1| and |##3| with the new key--value pair
+% \cs{l_@@_internal_tl}. The updated entry is placed at the same spot
+% as the original \meta{key} in the property list, preserving the
+% order of entries.
% \begin{macrocode}
-\cs_new_protected:Npn \prop_put:Nnn
+\cs_new_protected_nopar:Npn \prop_put:Nnn
{ \@@_put:NNNnn \tl_set:Nx \tl_put_right:Nx }
-\cs_new_protected:Npn \prop_gput:Nnn
+\cs_new_protected_nopar:Npn \prop_gput:Nnn
{ \@@_put:NNNnn \tl_gset:Nx \tl_gput_right:Nx }
\cs_new_protected:Npn \@@_put:NNNnn #1#2#3#4#5
{
+ \tl_set:Nn \l_@@_internal_tl
+ { \s_@@ \tl_to_str:n {#4} \s_@@ { \exp_not:n {#5} } }
\@@_split:NnTF #3 {#4}
- { \@@_put:NNnnnnn #1 #3 {#4} {#5} }
- { #2 #3 { \tl_to_str:n {#4} \exp_not:n { \q_@@ {#5} \q_@@ } } }
- }
-\cs_new_protected:Npn \@@_put:NNnnnnn #1#2#3#4#5#6#7
- {
- #1 #2
- {
- \exp_not:n {#5}
- \tl_to_str:n {#3} \exp_not:n { \q_@@ {#4} \q_@@ }
- \exp_not:n {#7}
- }
+ { #1 #3 { \exp_not:n {##1} \l_@@_internal_tl \exp_not:n {##3} } }
+ { #2 #3 { \l_@@_internal_tl } }
}
\cs_generate_variant:Nn \prop_put:Nnn
{ NnV , Nno , Nnx , NV , NVV , No , Noo }
@@ -814,12 +821,11 @@
{ \@@_put_if_new:NNnn \tl_gput_right:Nx }
\cs_new_protected:Npn \@@_put_if_new:NNnn #1#2#3#4
{
+ \tl_set:Nn \l_@@_internal_tl
+ { \s_@@ \tl_to_str:n {#3} \s_@@ \exp_not:n { {#4} } }
\@@_split:NnTF #2 {#3}
- { \use_none:nnn }
- {
- #1 #2
- { \tl_to_str:n {#3} \exp_not:n { \q_@@ {#4} \q_@@ } }
- }
+ { }
+ { #1 #2 { \l_@@_internal_tl } }
}
\cs_generate_variant:Nn \prop_put_if_new:Nnn { c }
\cs_generate_variant:Nn \prop_gput_if_new:Nnn { c }
@@ -833,32 +839,18 @@
% \begin{macro}[pTF, tested = m3prop004]{\prop_if_exist:N, \prop_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \prop_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \prop_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \prop_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \prop_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \prop_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \prop_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \prop_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \prop_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \prop_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \prop_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[pTF, tested = m3prop003]{\prop_if_empty:N, \prop_if_empty:c}
-% The test here uses \cs{c_empty_prop} as it is not really empty!
+% Same test as for token lists.
% \begin{macrocode}
-\prg_new_conditional:Npnn \prop_if_empty:N #1 { p, T , F , TF }
- {
- \if_meaning:w #1 \c_empty_prop
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \prop_if_empty_p:N {c}
-\cs_generate_variant:Nn \prop_if_empty:NTF {c}
-\cs_generate_variant:Nn \prop_if_empty:NT {c}
-\cs_generate_variant:Nn \prop_if_empty:NF {c}
+\prg_new_eq_conditional:NNn \prop_if_empty:N \tl_if_empty:N
+ { p , T , F , TF }
+\prg_new_eq_conditional:NNn \prop_if_empty:c \tl_if_empty:c
+ { p , T , F , TF }
% \end{macrocode}
% \end{macro}
%
@@ -885,12 +877,12 @@
% but \cs{@@_split:NnTF} is non-expandable.
%
% Instead, the key is compared to each key in turn using \cs{str_if_eq_x:nn},
-% which is expandable. To terminate the mapping, we add the key that
-% is search for at the end of the property list. This second
+% which is expandable. To terminate the mapping, we append to the property
+% list the key that is searched for. This second
% \cs{tl_to_str:n} is not expanded at the start, but only when included
% in the \cs{str_if_eq_x:nn}. It cannot make the breaking mechanism choke,
% because the arbitrary token list material is enclosed in braces.
-% When ending, we test the next token: it is either \cs{q_@@}
+% When ending, we test the next token: it is either \cs{s_@@}
% or \cs{q_recursion_tail} in the case of a missing key.
% Here, \cs{prop_map_function:NN} is not sufficient for the mapping,
% since it can only map a single token, and cannot carry the key that
@@ -900,11 +892,11 @@
{
\exp_last_unbraced:Noo \@@_if_in:nwn
{ \tl_to_str:n {#2} } #1
- \tl_to_str:n {#2} \q_@@ { }
- \q_recursion_tail % could be any cs != \q_@@
+ \s_@@ \tl_to_str:n {#2} \s_@@ { }
+ \q_recursion_tail
\__prg_break_point:
}
-\cs_new:Npn \@@_if_in:nwn #1 \q_@@ #2 \q_@@ #3
+\cs_new:Npn \@@_if_in:nwn #1 \s_@@ #2 \s_@@ #3
{
\str_if_eq_x:nnTF {#1} {#2}
{ \@@_if_in:N }
@@ -912,7 +904,7 @@
}
\cs_new:Npn \@@_if_in:N #1
{
- \if_meaning:w \q_@@ #1
+ \if_meaning:w \s_@@ #1
\prg_return_true:
\else:
\prg_return_false:
@@ -938,7 +930,6 @@
% \prop_get:NnN, \prop_get:NVN, \prop_get:NoN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:coN
% }
-% \begin{macro}[aux]{\@@_get_true:Nnnn}
% Getting the value corresponding to a key, keeping track of whether
% the key was present or not, is implemented as a conditional (with
% side effects). If the key was absent, the token list is not altered.
@@ -946,14 +937,12 @@
\prg_new_protected_conditional:Npnn \prop_get:NnN #1#2#3 { T , F , TF }
{
\@@_split:NnTF #1 {#2}
- { \@@_get_true:Nnnn #3 }
+ {
+ \tl_set:Nn #3 {##2}
+ \prg_return_true:
+ }
{ \prg_return_false: }
}
-\cs_new_protected:Npn \@@_get_true:Nnnn #1#2#3#4
- {
- \tl_set:Nn #1 {#3}
- \prg_return_true:
- }
\cs_generate_variant:Nn \prop_get:NnNT { NV , No }
\cs_generate_variant:Nn \prop_get:NnNF { NV , No }
\cs_generate_variant:Nn \prop_get:NnNTF { NV , No }
@@ -962,7 +951,6 @@
\cs_generate_variant:Nn \prop_get:NnNTF { c , cV , co }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \subsection{Mapping to property lists}
%
@@ -972,19 +960,24 @@
% \prop_map_function:cN, \prop_map_function:cc
% }
% \begin{macro}[aux]{\@@_map_function:Nwn}
-% The fastest way to do a recursion here would be to use an
+% The fastest way to do a recursion here is to use an
% \cs{if_meaning:w} test: the keys are strings, and thus
% cannot match the marker \cs{q_recursion_tail}.
+% A special case to note is when the key |#2| is empty:
+% then \cs{q_recursion_tail} is compared to \cs{exp_after:wN},
+% also different.
% \begin{macrocode}
\cs_new:Npn \prop_map_function:NN #1#2
{
\exp_last_unbraced:NNo \@@_map_function:Nwn #2
- #1 \q_recursion_tail \q_@@ { }
+ #1 \s_@@ \q_recursion_tail \s_@@ { }
\__prg_break_point:Nn \prop_map_break: { }
}
-\cs_new:Npn \@@_map_function:Nwn #1 \q_@@ #2 \q_@@ #3
+\cs_new:Npn \@@_map_function:Nwn #1 \s_@@ #2 \s_@@ #3
{
- \__quark_if_recursion_tail_break:nN {#2} \prop_map_break:
+ \if_meaning:w \q_recursion_tail #2
+ \exp_after:wN \prop_map_break:
+ \fi:
#1 {#2} {#3}
\@@_map_function:Nwn #1
}
@@ -1004,7 +997,7 @@
\exp_last_unbraced:Nco \@@_map_function:Nwn
{ __prg_map_ \int_use:N \g__prg_map_int :w }
#1
- \q_recursion_tail \q_@@ { }
+ \s_@@ \q_recursion_tail \s_@@ { }
\__prg_break_point:Nn \prop_map_break: { \int_gdecr:N \g__prg_map_int }
}
\cs_generate_variant:Nn \prop_map_inline:Nn { c }
@@ -1119,6 +1112,7 @@
% \begin{macro}{\prop_del:Nn, \prop_del:NV, \prop_del:cn, \prop_del:cV}
% \begin{macro}{\prop_gdel:Nn, \prop_gdel:NV, \prop_gdel:cn, \prop_gdel:cV}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \prop_del:Nn \prop_remove:Nn
\cs_new_eq:NN \prop_del:NV \prop_remove:NV
\cs_new_eq:NN \prop_del:cn \prop_remove:cn
@@ -1127,6 +1121,7 @@
\cs_new_eq:NN \prop_gdel:NV \prop_gremove:NV
\cs_new_eq:NN \prop_gdel:cn \prop_gremove:cn
\cs_new_eq:NN \prop_gdel:cV \prop_gremove:cV
+%</deprecated>
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
index f9c8f06e7e3..e917aeda4ea 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3seq.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3seq.dtx Copyright (C) 1990-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3seq.dtx 4339 2012-11-24 19:16:43Z joseph $
+\GetIdInfo$Id: l3seq.dtx 4434 2013-01-12 09:33:40Z bruno $
{L3 Sequences and stacks}
%</driver|package>
%<*driver>
@@ -437,8 +437,9 @@
% Applies \meta{function} to every \meta{item} stored in the
% \meta{sequence}. The \meta{function} will receive one argument for
% each iteration. The \meta{items} are returned from left to right.
-% The function \cs{seq_map_inline:Nn} is in general more efficient
-% than \cs{seq_map_function:NN}.
+% The function \cs{seq_map_inline:Nn} is faster than
+% \cs{seq_map_function:NN} for sequences with more than about~$10$
+% items.
% One mapping may be nested inside another.
% \end{function}
%
@@ -882,12 +883,10 @@
% \UnitTested
% Concatenating sequences is easy.
% \begin{macrocode}
-\cs_new_protected:Npn \seq_concat:NNN #1#2#3
- { \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
-\cs_new_protected:Npn \seq_gconcat:NNN #1#2#3
- { \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
-\cs_generate_variant:Nn \seq_concat:NNN { ccc }
-\cs_generate_variant:Nn \seq_gconcat:NNN { ccc }
+\cs_new_eq:NN \seq_concat:NNN \tl_concat:NNN
+\cs_new_eq:NN \seq_gconcat:NNN \tl_gconcat:NNN
+\cs_new_eq:NN \seq_concat:ccc \tl_concat:ccc
+\cs_new_eq:NN \seq_gconcat:ccc \tl_gconcat:ccc
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -895,14 +894,8 @@
% \begin{macro}[pTF]{\seq_if_exist:N, \seq_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \seq_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \seq_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \seq_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \seq_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \seq_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \seq_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \seq_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \seq_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \seq_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \seq_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1604,8 +1597,10 @@
%
% \begin{macro}{\seq_length:N, \seq_length:c}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \seq_length:N \seq_count:N
\cs_new_eq:NN \seq_length:c \seq_count:c
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1614,8 +1609,10 @@
% \begin{macro}{\seq_use:N, \seq_use:c}
% A simple short cut for a mapping.
% \begin{macrocode}
+%<*deprecated>
\cs_new:Npn \seq_use:N #1 { \seq_map_function:NN #1 \use:n }
\cs_generate_variant:Nn \seq_use:N { c }
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index 3eb3eb8c901..1a9d70f8756 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
%% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project
-%% (C) 2012 The LaTeX3 Project
+%% (C) 2012,2013 The 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
@@ -36,7 +36,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3skip.dtx 4260 2012-11-04 17:20:25Z joseph $
+\GetIdInfo$Id: l3skip.dtx 4444 2013-01-13 20:27:20Z bruno $
{L3 Dimensions and skips}
%</driver|package>
%<*driver>
@@ -228,16 +228,37 @@
% \end{center}
% \end{function}
%
-% \begin{function}[EXP,pTF]{\dim_compare:n}
+% \begin{function}[updated = 2013-01-13, EXP, pTF]{\dim_compare:n}
% \begin{syntax}
-% \cs{dim_compare_p:n} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \\
+% \cs{dim_compare_p:n} \\
+% ~~\{ \\
+% ~~~~\meta{dimexpr_1} \meta{relation_1} \\
+% ~~~~\ldots{} \\
+% ~~~~\meta{dimexpr_N} \meta{relation_N} \\
+% ~~~~\meta{dimexpr_{N+1}} \\
+% ~~\} \\
% \cs{dim_compare:nTF}
-% ~~\{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \}
+% ~~\{ \\
+% ~~~~\meta{dimexpr_1} \meta{relation_1} \\
+% ~~~~\ldots{} \\
+% ~~~~\meta{dimexpr_N} \meta{relation_N} \\
+% ~~~~\meta{dimexpr_{N+1}} \\
+% ~~\} \\
% ~~\Arg{true code} \Arg{false code}
% \end{syntax}
-% This function first evaluates each of the \meta{dimension expressions}
-% as described for \cs{dim_eval:n}. The two results are then
-% compared using the \meta{relation}:
+% This function evaluates the \meta{dimension expressions} as
+% described for \cs{dim_eval:n} and compares consecutive result using
+% the corresponding \meta{relation}, namely it compares
+% \meta{dimexpr_1} and \meta{dimexpr_2} using the \meta{relation_1},
+% then \meta{dimexpr_2} and \meta{dimexpr_3} using the
+% \meta{relation_2}, until finally comparing \meta{dimexpr_N} and
+% \meta{dimexpr_{N+1}} using the \meta{relation_N}. The test yields
+% \texttt{true} if all comparisons are \texttt{true}. Each
+% \meta{dimension expression} is evaluated only once, and the
+% evaluation is lazy, in the sense that if one comparison is
+% \texttt{false}, then no other \meta{dimension expression} is
+% evaluated and no other comparison is performed. The
+% \meta{relations} can be any of the following:
% \begin{center}
% \begin{tabular}{ll}
% Equal & |=| or |==| \\
@@ -331,35 +352,35 @@
% \texttt{false}.
% \end{function}
%
-% \begin{function}[rEXP]{\dim_do_until:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\dim_do_until:nn}
% \begin{syntax}
-% \cs{dim_do_until:nn} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \Arg{code}
+% \cs{dim_do_until:nn} \Arg{dimension relation} \Arg{code}
% \end{syntax}
% Places the \meta{code} in the input stream for \TeX{} to process, and
-% then evaluates the relationship between the two
-% \meta{dimension expressions} as described for \cs{dim_compare:nTF}.
+% then evaluates the \meta{dimension relation}
+% as described for \cs{dim_compare:nTF}.
% If the test is \texttt{false} then the \meta{code} will be inserted
% into the input stream again and a loop will occur until the
% \meta{relation} is \texttt{true}.
% \end{function}
%
-% \begin{function}[rEXP]{\dim_do_while:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\dim_do_while:nn}
% \begin{syntax}
-% \cs{dim_do_while:nn} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \Arg{code}
+% \cs{dim_do_while:nn} \Arg{dimension relation} \Arg{code}
% \end{syntax}
% Places the \meta{code} in the input stream for \TeX{} to process, and
-% then evaluates the relationship between the two
-% \meta{dimension expressions} as described for \cs{dim_compare:nTF}.
+% then evaluates the \meta{dimension relation}
+% as described for \cs{dim_compare:nTF}.
% If the test is \texttt{true} then the \meta{code} will be inserted
% into the input stream again and a loop will occur until the
% \meta{relation} is \texttt{false}.
% \end{function}
%
-% \begin{function}[rEXP]{\dim_until_do:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\dim_until_do:nn}
% \begin{syntax}
-% \cs{dim_until_do:nn} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \Arg{code}
+% \cs{dim_until_do:nn} \Arg{dimension relation} \Arg{code}
% \end{syntax}
-% Evaluates the relationship between the two \meta{dimension expressions}
+% Evaluates the \meta{dimension relation}
% as described for \cs{dim_compare:nTF}, and then places the
% \meta{code} in the input stream if the \meta{relation} is
% \texttt{false}. After the \meta{code} has been processed by \TeX{} the
@@ -367,11 +388,11 @@
% \texttt{true}.
% \end{function}
%
-% \begin{function}[rEXP]{\dim_while_do:nn}
+% \begin{function}[updated = 2013-01-13, rEXP]{\dim_while_do:nn}
% \begin{syntax}
-% \cs{dim_while_do:nn} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \Arg{code}
+% \cs{dim_while_do:nn} \Arg{dimension relation} \Arg{code}
% \end{syntax}
-% Evaluates the relationship between the two \meta{dimension expressions}
+% Evaluates the \meta{dimension relation}
% as described for \cs{dim_compare:nTF}, and then places the
% \meta{code} in the input stream if the \meta{relation} is
% \texttt{true}. After the \meta{code} has been processed by \TeX{} the
@@ -991,14 +1012,8 @@
% \begin{macro}[pTF]{\dim_if_exist:N, \dim_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \dim_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \dim_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \dim_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \dim_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \dim_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \dim_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \dim_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \dim_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \dim_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \dim_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1134,58 +1149,61 @@
% \end{macro}
%
% \begin{macro}[pTF, EXP]{\dim_compare:n}
-% \begin{macro}[aux, EXP]{\@@_compare_aux:w, \@@_compare_aux:NNw}
+% \begin{macro}[aux, EXP]{\@@_compare:w, \@@_compare:wNN}
% \begin{macro}[aux, EXP]
% {
-% \@@_compare_=:NNw,
-% \@@_compare_<:NNw,
-% \@@_compare_>:NNw,
-% \@@_compare_==:NNw,
-% \@@_compare_!=:NNw,
-% \@@_compare_<=:NNw,
-% \@@_compare_>=:NNw
+% \@@_compare_=:w,
+% \@@_compare_!:w,
+% \@@_compare_<:w,
+% \@@_compare_>:w
% }
% This code is adapted from the \cs{int_compare:nTF} function. First
-% evaluate the left-hand side. Then access the relation symbol by
-% grabbing until \texttt{pt} (with category other), and pursue
-% otherwise just as for \cs{int_compare:nTF}.
+% make sure that there is at least one relation operator, by
+% evaluating a dimension expression with a trailing
+% \cs{__prg_compare_error:}. Just like for integers, the looping
+% auxiliary \cs{@@_compare:wNN} closes a primitive conditional and
+% opens a new one. It is actually easier to grab a dimension operand
+% than an integer one, because once evaluated, dimensions all end with
+% \texttt{pt} (with category other). Thus we do not need specific
+% auxiliaries for the three \enquote{simple} relations |<|, |=|,
+% and~|>|.
% \begin{macrocode}
\prg_new_conditional:Npnn \dim_compare:n #1 { p , T , F , TF }
{
- \exp_after:wN \@@_compare_aux:w \dim_use:N \@@_eval:w #1
- \__prg_compare_error: \@@_eval_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
+ \exp_after:wN \@@_compare:w
+ \dim_use:N \@@_eval:w #1 \__prg_compare_error:
}
-\exp_args:Nno \use:nn
- { \cs_new:Npn \@@_compare_aux:w #1 }
- { \tl_to_str:n { pt } }
- #2 \__prg_compare_error:
+\cs_new:Npn \@@_compare:w #1 \__prg_compare_error:
{
- \exp_after:wN \@@_compare_aux:NNw #2 ?? \q_mark
- #1 pt #2
+ \exp_after:wN \if_false: \tex_romannumeral:D -`0
+ \@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \q_stop
}
-\cs_new:Npn \@@_compare_aux:NNw #1#2#3 \q_mark
+\exp_args:Nno \use:nn
+ { \cs_new:Npn \@@_compare:wNN #1 }
+ { \tl_to_str:n {pt} }
+ #2#3
{
- \use:c { @@_compare_ #1 \if_meaning:w = #2 = \fi: :NNw }
- \__prg_compare_error:Nw #1
+ \if_meaning:w = #3
+ \use:c { @@_compare_#2:w }
+ \fi:
+ #1 pt \exp_stop_f:
+ \prg_return_false:
+ \exp_after:wN \use_none_delimit_by_q_stop:w
+ \fi:
+ \reverse_if:N \if_dim:w #1 pt #2
+ \exp_after:wN \@@_compare:wNN
+ \dim_use:N \@@_eval:w #3
}
-\cs_new:cpn { @@_compare_=:NNw } #1#2#3 =
- { \if_dim:w #3 = \@@_eval:w }
-\cs_new:cpn { @@_compare_<:NNw } #1#2#3 <
- { \if_dim:w #3 < \@@_eval:w }
-\cs_new:cpn { @@_compare_>:NNw } #1#2#3 >
- { \if_dim:w #3 > \@@_eval:w }
-\cs_new:cpn { @@_compare_==:NNw } #1#2#3 ==
- { \if_dim:w #3 = \@@_eval:w }
-\cs_new:cpn { @@_compare_!=:NNw } #1#2#3 !=
- { \reverse_if:N \if_dim:w #3 = \@@_eval:w }
-\cs_new:cpn { @@_compare_<=:NNw } #1#2#3 <=
- { \reverse_if:N \if_dim:w #3 > \@@_eval:w }
-\cs_new:cpn { @@_compare_>=:NNw } #1#2#3 >=
- { \reverse_if:N \if_dim:w #3 < \@@_eval:w }
+\cs_new:cpn { @@_compare_ ! :w }
+ #1 \reverse_if:N #2 ! #3 = { #1 #2 = #3 }
+\cs_new:cpn { @@_compare_ = :w }
+ #1 \@@_eval:w = { #1 \@@_eval:w }
+\cs_new:cpn { @@_compare_ < :w }
+ #1 \reverse_if:N #2 < #3 = { #1 #2 > #3 }
+\cs_new:cpn { @@_compare_ > :w }
+ #1 \reverse_if:N #2 > #3 = { #1 #2 < #3 }
+\cs_new:Npn \@@_compare_end:w #1 \prg_return_false: #2 \q_stop
+ { #1 \prg_return_false: \else: \prg_return_true: \fi: }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1454,14 +1472,8 @@
% \begin{macro}[pTF]{\skip_if_exist:N, \skip_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \skip_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \skip_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \skip_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \skip_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \skip_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \skip_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \skip_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \skip_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \skip_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \skip_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1705,14 +1717,8 @@
% \begin{macro}[pTF]{\muskip_if_exist:N, \muskip_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \muskip_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \muskip_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \muskip_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \muskip_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \muskip_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \muskip_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \muskip_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \muskip_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \muskip_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \muskip_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -1847,8 +1853,10 @@
% \begin{macro}[EXP, pTF]{\skip_if_infinite_glue:n}
% Reverse of \cs{skip_if_finite:nTF}.
% \begin{macrocode}
+%<*deprecated>
\prg_new_conditional:Npnn \skip_if_infinite_glue:n #1 { p , T , F , TF }
{ \skip_if_finite:nTF {#1} \prg_return_false: \prg_return_true: }
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1858,14 +1866,18 @@
% Moved here, was in \pkg{l3prg} but load order means we define it here
% now.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \prg_case_dim:nnn \dim_case:nnn
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dim_eval:w, \dim_eval_end:}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \dim_eval:w \__dim_eval:w
\cs_new_eq:NN \dim_eval_end: \__dim_eval_end:
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -1876,6 +1888,7 @@
% \begin{macro}[aux]{\@@_set_max:NNNn}
% Deprecated on 2012-09-09 for removal after 2012-12-31.
% \begin{macrocode}
+%<*deprecated>
\cs_new_protected_nopar:Npn \dim_set_max:Nn
{ \@@_set_max:NNNn < \dim_set:Nn }
\cs_new_protected_nopar:Npn \dim_gset_max:Nn
@@ -1890,6 +1903,7 @@
\cs_generate_variant:Nn \dim_gset_max:Nn { c }
\cs_generate_variant:Nn \dim_set_min:Nn { c }
\cs_generate_variant:Nn \dim_gset_min:Nn { c }
+%</deprecated>
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index 0f166541978..dc164dc20c8 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3tl.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3tl.dtx Copyright (C) 1990-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3tl.dtx 4339 2012-11-24 19:16:43Z joseph $
+\GetIdInfo$Id: l3tl.dtx 4415 2013-01-08 12:32:51Z bruno $
{L3 Token lists}
%</driver|package>
%<*driver>
@@ -465,8 +465,8 @@
% \begin{function}[updated = 2011-08-13, EXP,pTF]
% {\tl_if_single:N, \tl_if_single:c}
% \begin{syntax}
-% \cs{tl_if_single_p:N} \Arg{tl~var}
-% \cs{tl_if_single:NTF} \Arg{tl~var} \Arg{true code} \Arg{false code}
+% \cs{tl_if_single_p:N} \meta{tl~var}
+% \cs{tl_if_single:NTF} \meta{tl~var} \Arg{true code} \Arg{false code}
% \end{syntax}
% Tests if the content of the \meta{tl~var} consists of a single item,
% \emph{i.e.}~is a single normal token (neither an explicit space
@@ -680,7 +680,7 @@
%
% \begin{function}[added = 2012-05-13, EXP]{\tl_count:N, \tl_count:c}
% \begin{syntax}
-% \cs{tl_count:N} \Arg{tl~var}
+% \cs{tl_count:N} \meta{tl~var}
% \end{syntax}
% Counts the number of token groups in the \meta{tl~var}
% and leaves this information in the input stream. Unbraced tokens
@@ -714,7 +714,7 @@
% \begin{function}[updated = 2012-01-08]
% {\tl_reverse:N, \tl_reverse:c, \tl_greverse:N, \tl_greverse:c}
% \begin{syntax}
-% \cs{tl_reverse:N} \Arg{tl~var}
+% \cs{tl_reverse:N} \meta{tl~var}
% \end{syntax}
% Reverses the order of the \meta{items} stored in \meta{tl~var}, so
% that \meta{item_1}\meta{item_2}\meta{item_3} \ldots \meta{item_n}
@@ -1150,14 +1150,8 @@
% \begin{macro}[pTF]{\tl_if_exist:N, \tl_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
% \begin{macrocode}
-\cs_new_eq:NN \tl_if_exist:NTF \cs_if_exist:NTF
-\cs_new_eq:NN \tl_if_exist:NT \cs_if_exist:NT
-\cs_new_eq:NN \tl_if_exist:NF \cs_if_exist:NF
-\cs_new_eq:NN \tl_if_exist_p:N \cs_if_exist_p:N
-\cs_new_eq:NN \tl_if_exist:cTF \cs_if_exist:cTF
-\cs_new_eq:NN \tl_if_exist:cT \cs_if_exist:cT
-\cs_new_eq:NN \tl_if_exist:cF \cs_if_exist:cF
-\cs_new_eq:NN \tl_if_exist_p:c \cs_if_exist_p:c
+\prg_new_eq_conditional:NNn \tl_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \tl_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
%
@@ -2543,7 +2537,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \tl_show:N #1
{
- \cs_if_exist:NTF #1
+ \tl_if_exist:NTF #1
{ \cs_show:N #1 }
{
\__msg_kernel_error:nnx { kernel } { variable-not-defined }
@@ -2704,7 +2698,9 @@
%
% \begin{macro}{\tl_length_tokens:n}
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \tl_length_tokens:n \tl_count_tokens:n
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -2714,11 +2710,13 @@
% {\tl_length:N, \tl_length:c, \tl_length:n, \tl_length:V, \tl_length:o}
% Renames.
% \begin{macrocode}
+%<*deprecated>
\cs_new_eq:NN \tl_length:N \tl_count:N
\cs_new_eq:NN \tl_length:c \tl_count:c
\cs_new_eq:NN \tl_length:n \tl_count:n
\cs_new_eq:NN \tl_length:V \tl_count:V
\cs_new_eq:NN \tl_length:o \tl_count:o
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -2730,8 +2728,10 @@
% a token list is empty if and only if its string representation is
% empty.
% \begin{macrocode}
+%<*deprecated>
\prg_new_conditional:Npnn \tl_if_empty:x #1 { p , T , F , TF }
{ \__str_if_eq_x_return:nn { } {#1} }
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
@@ -2741,12 +2741,14 @@
% \begin{macro}[EXP, pTF]{\tl_if_head_N_type:n}
% \begin{macro}[EXP, pTF]{\tl_if_head_space:n}
% \begin{macrocode}
+%<*deprecated>
\prg_new_eq_conditional:NNn \tl_if_head_group:n \tl_if_head_is_group:n
{ p , T , F , TF }
\prg_new_eq_conditional:NNn \tl_if_head_N_type:n \tl_if_head_is_N_type:n
{ p , T , F , TF }
\prg_new_eq_conditional:NNn \tl_if_head_space:n \tl_if_head_is_space:n
{ p , T , F , TF }
+%</deprecated>
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2756,11 +2758,12 @@
% Deprecated 2012-09-01 for removal after 2012-12-31. This is broken as
% it will strip braces from a case such as |a{bc}|.
% \begin{macrocode}
+%<*deprecated>
\cs_new:Npn \tl_tail:w #1#2 \q_stop {#2}
+%</deprecated>
% \end{macrocode}
% \end{macro}
%
-%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 6e3ef14d414..16e5510475a 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3token.dtx Copyright (C) 2005-2012 The LaTeX3 Project
+%% File: l3token.dtx Copyright (C) 2005-2013 The 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
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3token.dtx 4384 2012-12-20 15:47:56Z bruno $
+\GetIdInfo$Id: l3token.dtx 4428 2013-01-10 13:23:29Z bruno $
{L3 Experimental token manipulation}
%</driver|package>
%<*driver>
@@ -1759,7 +1759,7 @@
% token has either a space (e.g., |the letter A|), a digit
% (e.g., |\count123|) or a double quote (e.g., |\char"A|).
%
-% Ten exceptions: on the one hand, \cs{c_undefined:D} is not a
+% Ten exceptions: on the one hand, \cs{tex_undefined:D} is not a
% primitive, but its meaning is |undefined|, only letters;
% on the other hand, \tn{space}, \tn{italiccorr},
% \tn{hyphen}, \tn{firstmark}, \tn{topmark},
@@ -1781,7 +1781,7 @@
%
% We are now left with a string, which we must analyze. For primitives,
% it contains only letters. For non-primitives, it contains either
-% |"|, or a space, or a digit. Two exceptions remain: \cs{c_undefined:D},
+% |"|, or a space, or a digit. Two exceptions remain: \cs{tex_undefined:D},
% which is not a primitive, and \tn{nullfont}, which is a primitive.
%
% Spaces cannot be grabbed in an undelimited way, so we check them
@@ -1790,7 +1790,7 @@
% first character less than |`A| (this is not quite a test for
% \enquote{only letters}, but is close enough to work in this context).
% If this first character is |:| then we have a primitive, or
-% \cs{c_undefined:D}, and if it is |"| or a digit, then the token
+% \cs{tex_undefined:D}, and if it is |"| or a digit, then the token
% is not a primitive.
%
% \begin{macrocode}
@@ -2076,30 +2076,26 @@
% \end{macro}
%
% \begin{macro}{\@@_ignore_spaces_execute_branches:}
-% \begin{macro}[aux]{\@@_ignore_spaces_execute_branches_aux:}
-% This function removes one token at a time with the same mechanism as
-% \cs{@@_true_remove:w}. We directly use the primitive meaning test
-% rather than \cs{token_if_eq_meaning:NNTF} because \cs{l_peek_token}
-% may be an outer macro (coming from non-\LaTeX3 packages). We cannot
-% replace \cs{@@_tmp:w} by \cs{l_peek_token} here because if the
-% latter is an outer macro, it may not appear in the skipped branch of
-% a conditional.
+% This function removes one space token at a time, and calls
+% \cs{@@_execute_branches:} when encountering the first non-space
+% token. We directly use the primitive meaning test rather than
+% \cs{token_if_eq_meaning:NNTF} because \cs{l_peek_token} may be an
+% outer macro (coming from non-\LaTeX3 packages). Spaces are removed
+% using a side-effect of \texttt{f}-expansion:
+% |\tex_romannumeral:D -`0| removes one space.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ignore_spaces_execute_branches:
{
\if_meaning:w \l_peek_token \c_space_token
- \tex_afterassignment:D \@@_ignore_spaces_execute_branches_aux:
- \exp_after:wN \cs_set_eq:NN
- \exp_after:wN \@@_tmp:w
+ \exp_after:wN \peek_after:Nw
+ \exp_after:wN \@@_ignore_spaces_execute_branches:
+ \tex_romannumeral:D -`0
\else:
\exp_after:wN \@@_execute_branches:
\fi:
}
-\cs_new_protected_nopar:Npn \@@_ignore_spaces_execute_branches_aux:
- { \peek_after:Nw \@@_ignore_spaces_execute_branches: }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[aux]{\@@_def:nnnn}
% \begin{macro}[aux]{\@@_def:nnnnn}