On Thu, Mar 5, 2009 at 12:09 PM, Wolfgang Schuster <schuster.wolfg...@googlemail.com> wrote: > > 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? TeX version, not context ... :) btw \expandafer is not so bad, if used moderatly .
> > \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{} yes, of course one need to know about \expandafter... so is not so different . But it's context style. > >> %%% 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. Are you sure ? What is a normal user ? As soon as you use \dorecurse , you become a programmer . And sooner or later, everyone become a programmer, because it's impossible to write a format that satisfied all your needs . -- luigi ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________