From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21146 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: How to "\processcommalist"? Date: Mon, 04 Jul 2005 17:12:45 +0200 Message-ID: <42C951ED.3040400@wxs.nl> References: <6faad9f005070109152f691f61@mail.gmail.com> <42C5833A.3050204@elvenkind.com> <6faad9f005070111458d0e7fd@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1120490002 19116 80.91.229.2 (4 Jul 2005 15:13:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2005 15:13:22 +0000 (UTC) Cc: Taco Hoekwater Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 04 17:13:12 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpScf-0007Sk-LU for gctc-ntg-context-518@m.gmane.org; Mon, 04 Jul 2005 17:12:37 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4C366127D0; Mon, 4 Jul 2005 17:12:37 +0200 (CEST) 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 07133-03-9; Mon, 4 Jul 2005 17:12:32 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D1F3A127C6; Mon, 4 Jul 2005 17:12:32 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 47672127C6 for ; Mon, 4 Jul 2005 17:12:31 +0200 (CEST) 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 07133-03-8 for ; Mon, 4 Jul 2005 17:12:30 +0200 (CEST) Original-Received: from mailrelay01.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 45B04127C5 for ; Mon, 4 Jul 2005 17:12:30 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j64FCKYu008188; Mon, 4 Jul 2005 17:12:20 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 81A2E1A19D; Mon, 4 Jul 2005 16:37:05 +0200 (CEST) Original-Received: from [10.100.1.53] (unknown [10.100.1.53]) by server-1.pragma-net.nl (Postfix) with ESMTP id 0CE0817D3A; Mon, 4 Jul 2005 14:37:04 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: Mojca Miklavec , mailing list for ConTeXt users In-Reply-To: <6faad9f005070111458d0e7fd@mail.gmail.com> X-Virus-Scanned: ClamAV 0.86.1/965/Sun Jul 3 21:23:29 2005 on mailrelay01 X-Virus-Status: Clean X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21146 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21146 Mojca Miklavec wrote: > Taco Hoekwater wrote: > >>Mojca Miklavec wrote: >> >>>I would like to define a command, which would be called in the following way: >>> \TheBossWantsTheWorkToBeDoneOn[monday,wednesday,thursday]{tidy up} >>> >>>so that it would be equivalent to: >>> \WeHaveToDo[monday]{tidy up} >>> \WeHaveToDo[wednesday]{tidy up} >>> \WeHaveToDo[thursday]{tidy up} >>> >>>I played a bit with different variants of \processcommalist, but I >>>can't figure out how to use it in this particular case. >> >>The trick is to store the tidy up inside the processing command, >>like so: >> >> \def\WeHaveToDo[#1]#2{\message{(#1: #2)}} >> >> \def\TheBossWantsTheWorkToBeDoneOn[#1]#2% >> {\begingroup >> \def\processitem##1{\WeHaveToDo[##1]{#2}}% >> \processcommalist[#1]\processitem >> \endgroup } >> >> \TheBossWantsTheWorkToBeDoneOn[monday,wednesday,thursday]{tidy up} > > > Great, thanks Taco! It works. It seems easier than I thought, but I > could have spent hours looking for the proper solution alone. Actually, there is an easier way to do this; just swap the arguments to WeHaveToDo: \def\TheBossWantsTheWorkToBeDoneOn[#1]#2% {\processcommalist[#1]{\WeHaveToDo{#2}}} \def\WeHaveToDo#1#2{(#2: #1)} \starttext \TheBossWantsTheWorkToBeDoneOn[monday,wednesday,thursday]{tidy up} \stoptext btw, nice thread for a wiki entry > I hope this will land in the t-rsteps module (\OnSteps[1,2,3,6]{...}). > > >>>Is there also a possibility to define a command like >>> \IHaveToDoTheTasks[1-4,7,9-11]{until tomorrow} >> >>There was not, but knowing Hans I trust that soon there will be :-). hm, well, it does rain outside, but ... Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------