From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/48040 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \dorecurse and \recurselevel in Natural Tables Date: Thu, 5 Mar 2009 22:05:27 -0500 (EST) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1175037150-1236308728=:29619" X-Trace: ger.gmane.org 1236309097 31005 80.91.229.12 (6 Mar 2009 03:11:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2009 03:11:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Mar 06 04:12:53 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LfQUT-0004wB-Hv for gctc-ntg-context-518@m.gmane.org; Fri, 06 Mar 2009 04:12:49 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 65B931FB3C; Fri, 6 Mar 2009 04:10:29 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14275-03; Fri, 6 Mar 2009 04:08:35 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 251101FADC; Fri, 6 Mar 2009 04:08:19 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4E65C1FADC for ; Fri, 6 Mar 2009 04:07:20 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13340-02-4 for ; Fri, 6 Mar 2009 04:06:17 +0100 (CET) Original-Received: from filter2-nij.mf.surf.net (filter2-nij.mf.surf.net [195.169.124.153]) by ronja.ntg.nl (Postfix) with ESMTP id 09B3C1FADB for ; Fri, 6 Mar 2009 04:06:08 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter2-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n26365Od002081 for ; Fri, 6 Mar 2009 04:06:07 +0100 Original-Received: FROM [192.168.2.8] (c-71-234-195-113.hsd1.ct.comcast.net [71.234.195.113]) BY hackers.mr.itd.umich.edu ID 49B0931B.AD9B7.32386 ; 5 Mar 2009 22:06:03 -0500 In-Reply-To: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 189417662 - fa6b3d669596 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:48040 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1175037150-1236308728=:29619 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 5 Mar 2009, luigi scarso wrote: > On Thu, Mar 5, 2009 at 12:09 PM, Wolfgang Schuster > wrote: >> >> Am 05.03.2009 um 01:17 schrieb luigi scarso: >> >>> \starttext >>> %%% TeX version >>> \bTABLE >>> \dorecurse{5} >>> {\bTR\expandafter \bTD \recurselevel. \eTD\expandafter >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0\bTD \recurselevel =C2=A0\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 differ= ent . > But it's context style. > >> >>> %%% luatex version >>> \startluacode >>> =C2=A0 tprint =3D function(s) tex.sprint(tex.ctxcatcodes,s) end >>> =C2=A0 tprint('\\bTABLE') >>> =C2=A0 for j =3D 1,5 do >>> =C2=A0 =C2=A0 =C2=A0 tprint('\\bTR') >>> =C2=A0 =C2=A0 =C2=A0 tprint('\\bTD' .. j .. '.' .. '\\eTD' .. '\\bTD' .= =2E j .. '\\eTD') >>> =C2=A0 =C2=A0 =C2=A0 tprint('\\eTR') >>> =C2=A0 end >>> =C2=A0 tprint('\\eTABLE') >>> \stopluacode >>> \stoptext >> >> Nice solution and real alternative for package writers to avoid \expanda= fter >> and \expanded but nothing for a normal user, I should keep this in my mi= nd. > 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 . My summary of this thread: http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-= the-present-and-the-future/ Aditya --8323328-1175037150-1236308728=:29619 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --8323328-1175037150-1236308728=:29619--