From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21115 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: How to "\processcommalist"? Date: Fri, 1 Jul 2005 20:45:19 +0200 Message-ID: <6faad9f005070111458d0e7fd@mail.gmail.com> References: <6faad9f005070109152f691f61@mail.gmail.com> <42C5833A.3050204@elvenkind.com> Reply-To: Mojca Miklavec , mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1120243329 27673 80.91.229.2 (1 Jul 2005 18:42:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2005 18:42:09 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 01 20:42:03 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 1DoQSf-0006Lw-1z for gctc-ntg-context-518@m.gmane.org; Fri, 01 Jul 2005 20:42:01 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B6199127ED; Fri, 1 Jul 2005 20:49:41 +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 27193-02; Fri, 1 Jul 2005 20:49:41 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DB078127E0; Fri, 1 Jul 2005 20:45:21 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A162C127E0 for ; Fri, 1 Jul 2005 20:45:20 +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 26886-06-2 for ; Fri, 1 Jul 2005 20:45:19 +0200 (CEST) Original-Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.202]) by ronja.ntg.nl (Postfix) with ESMTP id B1245127A3 for ; Fri, 1 Jul 2005 20:45:19 +0200 (CEST) Original-Received: by nproxy.gmail.com with SMTP id a4so92555nfc for ; Fri, 01 Jul 2005 11:45:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Vb5NLeJEHGT/1bRJn3usgf+ImdptEXNE+cFmw7mrWSovmglKYlYcRs7dg8o7ZTd/dkVzNm+mDoNYlcceRmOInNmpbhbf7ZGoAxB9jzV8Mgq42KZLfnKPC/DOaeLOCLtzBnfBOiHXK+8sOb+2Ftzpx/1LonGznciQVGG96XPSxzc= Original-Received: by 10.48.3.14 with SMTP id 14mr61193nfc; Fri, 01 Jul 2005 11:45:19 -0700 (PDT) Original-Received: by 10.48.247.2 with HTTP; Fri, 1 Jul 2005 11:45:19 -0700 (PDT) Original-To: mailing list for ConTeXt users , Taco Hoekwater In-Reply-To: <42C5833A.3050204@elvenkind.com> Content-Disposition: inline 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:21115 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21115 Taco Hoekwater wrote: > Mojca Miklavec wrote: > > I would like to define a command, which would be called in the followin= g 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. >=20 > The trick is to store the tidy up inside the processing command, > like so: >=20 > \def\WeHaveToDo[#1]#2{\message{(#1: #2)}} >=20 > \def\TheBossWantsTheWorkToBeDoneOn[#1]#2% > {\begingroup > \def\processitem##1{\WeHaveToDo[##1]{#2}}% > \processcommalist[#1]\processitem > \endgroup } >=20 > \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. 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} >=20 > There was not, but knowing Hans I trust that soon there will be :-). :) > For now, here is my solution. >=20 > [...] > > With these, you can do: >=20 > \def\IHaveToDoTheTask[#1]#2{\message{(#1: #2)}} >=20 > \def\IHaveToDoTheTasks[#1]#2% > {\begingroup > \def\processitem##1{\IHaveToDoTheTask[##1]{#2}}% > \uncompresslist[#1]% <=3D Yeah! > \processcommacommand[\uncompressedlist]\processitem > \endgroup } >=20 > I hope you understand what I've done, but otherwise, feel > free to ask, of course. Well, my stomach needs some time to process the latter example. But if I wr= ite \def\IHaveToDoTheTask[#1]#2{\message{(#1: #2)}The task #1 has to be done #2.\crlf} \IHaveToDoTheTasks[1-3]{until tomorrow} nothing happens. Thanks again, Mojca