summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/expl3/l3clist.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3clist.dtx')
-rw-r--r--Master/texmf-dist/source/latex/expl3/l3clist.dtx33
1 files changed, 20 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3clist.dtx b/Master/texmf-dist/source/latex/expl3/l3clist.dtx
index 1bee2934399..0155c64f394 100644
--- a/Master/texmf-dist/source/latex/expl3/l3clist.dtx
+++ b/Master/texmf-dist/source/latex/expl3/l3clist.dtx
@@ -36,7 +36,7 @@
\RequirePackage{l3names}
%</driver|package>
%\fi
-\GetIdInfo$Id: l3clist.dtx 725 2007-12-22 21:25:00Z mittelba $
+\GetIdInfo$Id: l3clist.dtx 745 2008-08-03 18:50:46Z morten $
{L3 Experimental comma separated lists}
%\iffalse
%<*driver>
@@ -736,7 +736,7 @@
% we did. If we didn't, place the function "#1" in front of the
% element "#2", which is surrounded by braces.
% \begin{macrocode}
-\def_new:Npn \clist_map_function_aux:Nw #1#2,{
+\def_long_new:Npn \clist_map_function_aux:Nw #1#2,{
\quark_if_recursion_tail_stop:n{#2}
#1{#2}
\clist_map_function_aux:Nw #1
@@ -760,13 +760,20 @@
% that all of the functions called have distict names. A simpler
% approach would of course be to use grouping and thus the save
% stack but then you lose the ability to do things locally.
+%
+% A funny little thing occured in one document: The command setting
+% up the first call of |\clist_map_inline:Nn| was used in a tabular
+% cell and the inline code used |\\| so the loop broke as soon as
+% this happened. Lesson to be learned from this: If you wish to have
+% group like structure but not using the groupings of \TeX, then do
+% every operation globally.
% \begin{macrocode}
-\int_new:N \l_clist_inline_level_int
-\def_new:Npn \clist_map_inline:Nn #1#2{
+\int_new:N \g_clist_inline_level_int
+\def_long_new:Npn \clist_map_inline:Nn #1#2{
\clist_if_empty:NF #1
{
- \int_incr:N \l_clist_inline_level_int
- \def:cpn {clist_map_inline_ \int_use:N \l_clist_inline_level_int :n}
+ \int_gincr:N \g_clist_inline_level_int
+ \gdef_long:cpn {clist_map_inline_ \int_use:N \g_clist_inline_level_int :n}
##1{#2}
% \end{macrocode}
% Recall that the |E| in |\exp_args:NcE| means `single token expanded
@@ -776,22 +783,22 @@
% |\clist_map_function_aux:Nw| for the actual loop.
% \begin{macrocode}
\exp_args:NcE \clist_map_function_aux:Nw
- {clist_map_inline_ \int_use:N \l_clist_inline_level_int :n}
+ {clist_map_inline_ \int_use:N \g_clist_inline_level_int :n}
#1 , \q_recursion_tail , \q_recursion_stop
- \int_decr:N \l_clist_inline_level_int
+ \int_gdecr:N \g_clist_inline_level_int
}
}
\def_new:Npn \clist_map_inline:cn{\exp_args:Nc\clist_map_inline:Nn}
-\def_new:Npn \clist_map_inline:nn #1#2{
+\def_long_new:Npn \clist_map_inline:nn #1#2{
\tlist_if_empty:nF {#1}
{
- \int_incr:N \l_clist_inline_level_int
- \def:cpn {clist_map_inline_ \int_use:N \l_clist_inline_level_int :n}
+ \int_gincr:N \g_clist_inline_level_int
+ \gdef_long:cpn {clist_map_inline_ \int_use:N \g_clist_inline_level_int :n}
##1{#2}
\exp_args:Nc \clist_map_function_aux:Nw
- {clist_map_inline_ \int_use:N \l_clist_inline_level_int :n}
+ {clist_map_inline_ \int_use:N \g_clist_inline_level_int :n}
#1 , \q_recursion_tail , \q_recursion_stop
- \int_decr:N \l_clist_inline_level_int
+ \int_gdecr:N \g_clist_inline_level_int
}
}
% \end{macrocode}