summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3prg.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx96
1 files changed, 74 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index 0db3e319bb2..0c81f7f9951 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prg.dtx 4061 2012-08-08 15:19:07Z bruno $
+\GetIdInfo$Id: l3prg.dtx 4114 2012-08-16 01:57:02Z bruno $
{L3 Control structures}
%</driver|package>
%<*driver>
@@ -282,8 +282,8 @@
%
% \begin{function}[EXP,pTF]{\bool_if:N, \bool_if:c}
% \begin{syntax}
-% \cs{bool_if_p:N} \Arg{boolean}
-% \cs{bool_if:NTF} \Arg{boolean} \Arg{true code} \Arg{false code}
+% \cs{bool_if_p:N} \meta{boolean}
+% \cs{bool_if:NTF} \meta{boolean} \Arg{true code} \Arg{false code}
% \end{syntax}
% Tests the current truth of \meta{boolean}, and continues expansion
% based on this result.
@@ -406,11 +406,33 @@
%
% \section{Logical loops}
%
-% Loops using either boolean expressions or stored boolean values.
+% Loops using either boolean expressions or stored boolean values.
+%
+% \begin{function}[rEXP]{\bool_do_until:Nn, \bool_do_until:cn}
+% \begin{syntax}
+% \cs{bool_do_until:Nn} \meta{boolean} \Arg{code}
+% \end{syntax}
+% Places the \meta{code} in the input stream for \TeX{} to process,
+% and then checks the logical value of the \meta{boolean}. If it is
+% \texttt{false} then the \meta{code} will be inserted into the input
+% stream again and the process will loop until the \meta{boolean} is
+% \texttt{true}.
+% \end{function}
+%
+% \begin{function}[rEXP]{\bool_do_while:Nn, \bool_do_while:cn}
+% \begin{syntax}
+% \cs{bool_do_while:Nn} \meta{boolean} \Arg{code}
+% \end{syntax}
+% Places the \meta{code} in the input stream for \TeX{} to process,
+% and then checks the logical value of the \meta{boolean}. If it is
+% \texttt{true} then the \meta{code} will be inserted into the input
+% stream again and the process will loop until the \meta{boolean} is
+% \texttt{false}.
+% \end{function}
%
% \begin{function}[rEXP]{\bool_until_do:Nn, \bool_until_do:cn}
% \begin{syntax}
-% \cs{bool_until_do:Nn} \Arg{boolean} \Arg{code}
+% \cs{bool_until_do:Nn} \meta{boolean} \Arg{code}
% \end{syntax}
% This function firsts checks the logical value of the \meta{boolean}.
% If it is \texttt{false} the \meta{code} is placed in the input stream
@@ -421,7 +443,7 @@
%
% \begin{function}[rEXP]{\bool_while_do:Nn, \bool_while_do:cn}
% \begin{syntax}
-% \cs{bool_while_do:Nn} \Arg{boolean} \Arg{code}
+% \cs{bool_while_do:Nn} \meta{boolean} \Arg{code}
% \end{syntax}
% This function firsts checks the logical value of the \meta{boolean}.
% If it is \texttt{true} the \meta{code} is placed in the input stream
@@ -430,6 +452,30 @@
% until the \meta{boolean} is \texttt{false}.
% \end{function}
%
+% \begin{function}[rEXP, updated = 2012-07-08]{\bool_do_until:nn}
+% \begin{syntax}
+% \cs{bool_do_until:nn} \Arg{boolean expression} \Arg{code}
+% \end{syntax}
+% Places the \meta{code} in the input stream for \TeX{} to process,
+% and then checks the logical value of the \meta{boolean expression}
+% as described for \cs{bool_if:nTF}. If it is \texttt{false} then the
+% \meta{code} will be inserted into the input stream again and the
+% process will loop until the \meta{boolean expression} evaluates to
+% \texttt{true}.
+% \end{function}
+%
+% \begin{function}[rEXP, updated = 2012-07-08]{\bool_do_while:nn}
+% \begin{syntax}
+% \cs{bool_do_while:nn} \Arg{boolean expression} \Arg{code}
+% \end{syntax}
+% Places the \meta{code} in the input stream for \TeX{} to process,
+% and then checks the logical value of the \meta{boolean expression}
+% as described for \cs{bool_if:nTF}. If it is \texttt{true} then the
+% \meta{code} will be inserted into the input stream again and the
+% process will loop until the \meta{boolean expression} evaluates to
+% \texttt{false}.
+% \end{function}
+%
% \begin{function}[rEXP, updated = 2012-07-08]{\bool_until_do:nn}
% \begin{syntax}
% \cs{bool_until_do:nn} \Arg{boolean expression} \Arg{code}
@@ -789,7 +835,7 @@
%
% \begin{macro}{\bool_show:N, \bool_show:c, \bool_show:n}
% Show the truth value of the boolean, as \texttt{true} or
-% \texttt{false}. We use \cs{__msg_show_variable:x} to get a better output;
+% \texttt{false}. We use \cs{__msg_show_variable:n} to get a better output;
% this function requires its argument to start with |>|.
% \begin{macrocode}
\cs_new_protected:Npn \bool_show:N #1
@@ -804,8 +850,8 @@
\cs_new_protected:Npn \bool_show:n #1
{
\bool_if:nTF {#1}
- { \__msg_show_variable:x { > true } }
- { \__msg_show_variable:x { > false } }
+ { \__msg_show_variable:n { > true } }
+ { \__msg_show_variable:n { > false } }
}
\cs_generate_variant:Nn \bool_show:N { c }
% \end{macrocode}
@@ -1182,7 +1228,7 @@
% \begin{macrocode}
\cs_new:Npn \bool_not_p:n #1 { \bool_if_p:n { ! ( #1 ) } }
% \end{macrocode}
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bool_xor_p:nn}
% \UnitTested
@@ -1242,7 +1288,7 @@
% \bool_while_do:nn, \bool_do_while:nn ,
% \bool_until_do:nn, \bool_do_until:nn
% }
-% \UnitTested
+% \UnitTested
% Loop functions with the test either before or after the first body
% expansion.
% \begin{macrocode}
@@ -1479,11 +1525,21 @@
%
% \begin{macro}[int]{\scan_align_safe_stop:}
% When \TeX{} is in the beginning of an align cell (right after the
-% \tn{cr}) it is in a somewhat strange mode as it is looking ahead to
-% find an \tn{omit} or \tn{noalign} and hasn't looked at the
-% preamble yet. Thus an \tn{ifmmode} test will always fail unless
-% we insert \cs{scan_stop:} to stop \TeX{}'s scanning ahead. On the other
-% hand we don't want to insert a \cs{scan_stop:} every time as that will
+% \tn{cr} or |&|) it is in a somewhat strange mode as it is looking
+% ahead to find an \tn{omit} or \tn{noalign} and hasn't looked at the
+% preamble yet. Thus an \tn{ifmmode} test at the start of an array
+% cell (where math mode is introduced by the preamble, not in the cell
+% itself) will always fail unless we stop \TeX{} from scanning ahead.
+% With \eTeX{}'s first version, this required inserting
+% \cs{scan_stop:}, but not in all cases (see below). This is no
+% longer needed with a newer \eTeX{}, since protected macros are not
+% expanded anymore at the beginning of an alignment cell. We can thus
+% use an empty protected macro to stop \TeX{}.
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \scan_align_safe_stop: { }
+% \end{macrocode}
+% Let us now explain the earlier version. We don't want to insert
+% a \cs{scan_stop:} every time as that will
% destroy kerning between letters\footnote{Unless we enforce an extra
% pass with an appropriate value of \tn{pretolerance}.}
% Unfortunately there is no way to detect if we're in the beginning of
@@ -1508,12 +1564,8 @@
% }
% }
% \end{verbatim}
-% However, this is not truly expandable, as there are places where the
-% \cs{scan_stop:} ends up in the result. A simpler alternative, which
-% can be used selectively, is therefore defined.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \scan_align_safe_stop: { }
-% \end{macrocode}
+% However, this is not truly expandable, as there are places where the
+% \cs{scan_stop:} ends up in the result.
% \end{macro}
%
% \begin{macrocode}