From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/12329 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: how to dismantle parametrized macro Date: Wed, 21 May 2003 14:30:44 +0200 Sender: ntg-context-admin@ntg.nl Message-ID: <5.2.0.9.1.20030521142856.01af96b0@server-1> References: <20030520141437.GB1572@ruhrau.de> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1053520958 10023 80.91.224.249 (21 May 2003 12:42:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 21 May 2003 12:42:38 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Wed May 21 14:42:36 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ISu5-0002VM-00 for ; Wed, 21 May 2003 14:41:09 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 60D6F10B2C; Wed, 21 May 2003 14:42:59 +0200 (MEST) Original-Received: from mail.solcon.nl (mail.solcon.nl [212.45.33.11]) by ref.ntg.nl (Postfix) with ESMTP id 7857810B15 for ; Wed, 21 May 2003 14:31:28 +0200 (MEST) Original-Received: from server-1.pragma-net.nl (wc-58016.solcon.nl [212.45.58.16]) by mail.solcon.nl (8.12.9/SQL-8.12.9-10/8.12.5) with ESMTP id h4LCVLnE015263 for ; Wed, 21 May 2003 14:31:21 +0200 Original-Received: from laptop-3.wxs.nl (laptop-3 [10.100.1.191]) by server-1.pragma-net.nl (8.12.3/8.12.2) with ESMTP id h4LCVN0i032105 for ; Wed, 21 May 2003 14:31:24 +0200 X-Sender: hagen-mail@server-1 X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Original-To: ntg-context@ntg.nl In-Reply-To: <20030520141437.GB1572@ruhrau.de> X-RAVMilter-Version: 8.4.1(snapshot 20020919) (mail.solcon.nl) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:12329 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:12329 At 16:14 20/05/2003 +0200, you wrote: >\def\dodefineCBpalet[#1][#2]% > { > \def\sep{} > \ifsecondargument > \getparameters[CB][\c!n=,#2] > \else > \def\CBn{3} > \fi ^^^ this can be simplified (see code below) > \def\colorlist{% > \dorecurse{\CBn}{ > \sep #1:\recurselevel=#1:\recurselevel:\CBn > \def\sep{,}}} > \definepalet[#1][\colorlist]} this way some loop is executed as argument, and that will fail (not fully expandable and so) >\defineCBpalet[Accent][n=5] > >% I want this to expand into (without the indentation): >% \definepalet[Accent] >% [Accent:1=Accent:1:5, >% Accent:2=Accent:2:5, >% Accent:3=Accent:3:5, >% Accent:4=Accent:4:5, >% Accent:5=Accent:5:5] > >\starttext > >\comparepalet[Accent] > >\stoptext The solution to this is to construct the comma list: \def\defineCBpalet{\dodoubleempty\dodefineCBpalet} \def\dodefineCBpalet[#1][#2]% {\getparameters[CB][\c!n=3,#2] \let\CBcolorlist\empty \dorecurse\CBn {\addtocommalist {#1:\recurselevel=#1:\recurselevel:\CBn} % is always expanded \CBcolorlist} \expanded{\definepalet[#1][\CBcolorlist]}} \defineCBpalet[Accent][n=5] ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------