summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/expl3/l3num.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-08-02 23:18:13 +0000
committerKarl Berry <karl@freefriends.org>2008-08-02 23:18:13 +0000
commit81dde574dee7e20779753c076ece922cdcba0fb0 (patch)
tree6fd6b740c2e6e9fd836ecef99b265445eb8dfae0 /Master/texmf-dist/source/latex/expl3/l3num.dtx
parent1a1b8177153694d230e0fcc3f541b242330aa067 (diff)
expl3 update (2aug08)
git-svn-id: svn://tug.org/texlive/trunk@10021 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3num.dtx')
-rw-r--r--Master/texmf-dist/source/latex/expl3/l3num.dtx52
1 files changed, 27 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3num.dtx b/Master/texmf-dist/source/latex/expl3/l3num.dtx
index 624cd7668e5..325eef2e131 100644
--- a/Master/texmf-dist/source/latex/expl3/l3num.dtx
+++ b/Master/texmf-dist/source/latex/expl3/l3num.dtx
@@ -1,5 +1,5 @@
% \iffalse
-%% File: l3num.dtx Copyright (C) 2005-2006 Frank Mittelbach, LaTeX3 project
+%% File: l3num.dtx Copyright (C) 2005-2008 Frank Mittelbach, 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 @@
\RequirePackage{l3names}
%</driver|package>
%\fi
-\GetIdInfo$Id: l3num.dtx 702 2007-11-27 14:21:49Z morten $
+\GetIdInfo$Id: l3num.dtx 741 2008-08-01 13:37:16Z morten $
{L3 Experimental token numbers}
%\iffalse
%<*driver>
@@ -237,7 +237,16 @@
% \end{syntax}
% Return the numerical value of a \m{num} expression.
% \end{function}
-
+%
+% \begin{function}{%
+% \num_elt_count:n |
+% }
+% \begin{syntax}
+% "\num_elt_count:n" "{"<balanced text>"}"
+% \end{syntax}
+% Discards \m{balanced text} and puts a "+1" in the input stream. Used
+% to count elements in a token list.
+% \end{function}
%
% \subsection{Formatting a counter value}
%
@@ -316,11 +325,11 @@
% \num_eval:w |
% }
% \begin{syntax}
-% "\num_eval:w" <integer expression> "\scan_stop:"
+% "\num_eval:w" <integer expression> "\num_eval_end:"
% \end{syntax}
% Evaluates <integer expression>. The evaluation stops when an
% unexpandable token of catcode other than 12 is reached or
-% "\scan_stop:" is read. The latter is gobbled by the scanner
+% "\num_eval_end:" is read. The latter is gobbled by the scanner
% mechanism.
% \begin{texnote}
% This is the \eTeX{} primitive \tn{numexpr}.
@@ -384,6 +393,7 @@
%
% \begin{macro}{\num_value:w}
% \begin{macro}{\num_eval:w}
+% \begin{macro}{\num_eval_end:}
% \begin{macro}{\if_num:w}
% \begin{macro}{\if_num_odd:w}
% \begin{macro}{\if_case:w}
@@ -393,6 +403,7 @@
% \begin{macrocode}
\let_new:NN \num_value:w \tex_number:D
\let_new:NN \num_eval:w \etex_numexpr:D
+\let_new:NN \num_eval_end: \scan_stop:
\let_new:NN \if_num:w \tex_ifnum:D
\let_new:NN \if_num_odd:w \tex_ifodd:D
\let_new:NN \if_case:w \tex_ifcase:D
@@ -404,25 +415,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-%
-% \begin{macro}{\use_arg_after_or:w}
-% \begin{macro}{\use_arg_after_else:w}
-% \begin{macro}{\use_arg_after_fi:w}
-% When you're using the |\if_case:w| primitive it is not as easy as
-% usual to get the code to be executed past the |\or:|, |\else:| and
-% |\fi:|. If you know that there is only one token, then prefix it
-% with |\exp_after:NN|, else you can use these functions. Be sure to
-% hide any |\if| functions in the skipped text!
-%
-% All other conditionals are two way switches for which you can just
-% use the safe methods provided by the TF type functions.
-% \begin{macrocode}
-\def_long_new:Npn \use_arg_after_or:w #1\or: #2\fi:{\fi: #1}
-\def_long_new:Npn \use_arg_after_else:w #1\else: #2\fi:{\fi: #1}
-\def_long_new:Npn \use_arg_after_fi:w #1\fi:{\fi: #1}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
% \end{macro}
%
% Functions that support \LaTeX's user accessible counters should be
@@ -494,7 +486,7 @@
% This function enables us to do all the operations without the aid of
% an \m{int} register.
% \begin{macrocode}
-\def_new:Npn \num_eval:n #1{\num_eval:w #1\scan_stop:}
+\def_new:Npn \num_eval:n #1{\num_eval:w #1\num_eval_end:}
% \end{macrocode}
% \end{macro}
%
@@ -619,6 +611,16 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\num_elt_count:n}
+% \begin{macro}{\num_elt_count_prop:Nn}
+% Helper function for counting elements in a list.
+% \begin{macrocode}
+\def_long_new:Npn \num_elt_count:n #1 { + 1 }
+\def_long_new:Npn \num_elt_count_prop:Nn #1#2 { + 1 }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\l_tmpa_num}
% \begin{macro}{\l_tmpb_num}
% \begin{macro}{\l_tmpc_num}