Am 05.03.2009 um 01:17 schrieb luigi scarso:
\starttext %%% TeX version \bTABLE \dorecurse{5} {\bTR\expandafter \bTD \recurselevel. \eTD\expandafter \bTD \recurselevel \eTD\eTR} \eTABLE
\dorecurse{2} {\recurselevel. \recurselevel\crlf}
And you think it's a good idea to use \expandafter in your document? \expanded is the tool for users to get this result without knowledge about TeX internals and expansion, this is from core-ntb: % permits \expanded{\bTD ... \eTD} \unexpanded\def\eTR{} \unexpanded\def\eTD{} \unexpanded\def\eTH{} \unexpanded\def\eTN{}
%%% luatex version \startluacode tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end tprint('\\bTABLE') for j = 1,5 do tprint('\\bTR') tprint('\\bTD' .. j .. '.' .. '\\eTD' .. '\\bTD' .. j .. '\ \eTD') tprint('\\eTR') end tprint('\\eTABLE') \stopluacode \stoptext
Nice solution and real alternative for package writers to avoid \expandafter and \expanded but nothing for a normal user, I should keep this in my mind. Wolfgang