From 7fe74d9b728f85523bb0a77b231fe16d379c6265 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 6 Aug 2008 23:37:15 +0000
Subject: expl3 update (6aug08)

git-svn-id: svn://tug.org/texlive/trunk@10123 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/latex/expl3/l3clist.dtx | 33 ++++++++++++++----------
 1 file changed, 20 insertions(+), 13 deletions(-)

(limited to 'Master/texmf-dist/source/latex/expl3/l3clist.dtx')

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}
-- 
cgit v1.2.3

