Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p4SHIhFN023573 for ; Sat, 28 May 2011 19:18:44 +0200 Received: (qmail 8748 invoked by alias); 28 May 2011 17:18:38 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 28 May 2011 17:18:37 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx114) with SMTP; 28 May 2011 19:18:37 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p4SHGQJv011967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 May 2011 19:16:26 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p4RM17HM002144; Sat, 28 May 2011 19:16:26 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1212899 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 28 May 2011 19:16:26 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p4SHGPOS016110 for ; Sat, 28 May 2011 19:16:26 +0200 Received: from lon1-post-1.mail.demon.net (lon1-post-1.mail.demon.net [195.173.77.148]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p4SHG9J3011946 for ; Sat, 28 May 2011 19:16:13 +0200 Received: from morningstar2.demon.co.uk ([80.176.134.7] helo=palladium.local) by lon1-post-1.mail.demon.net with esmtp (Exim 4.69) id 1QQN7R-0003hz-Y0; Sat, 28 May 2011 17:16:09 +0000 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 References: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4DE12DD9.9000805@morningstar2.co.uk> Date: Sat, 28 May 2011 18:16:09 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: xparse, "while" argument type To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p4yCuwxJv6KY6ambsbnOIeuclqizZVtbV/oxkgsL71xlZsD7QpKcDoDXH7wL cK8dy/FQWJOsS4TzPdyuLs+YTUQV16xZxiyzH5BbzFKvwJidGugkMGDShByRlua5U143c1VI5Okk KmdzTF1OOF6VUbXzMIUx3lM+YM5XfrjjH0aR0Qz5Ab+8T/hXnXvrkYEbd/9dBlcaovrUA==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6770 On 28/05/2011 18:08, Bruno Le Floch wrote: > Hello all, > > on the TeX.stackexchange Q&A website [1], was asked the following > question: how do I get with xparse a macro with three optional > arguments: > (without the <>). This can be achieved by providing a new argument > type, which collects tokens as long as they obey a user-defined > condition. Namely, > > \DeclareDocumentCommand{\X} > { > W { \token_if_eq_meaning:NNTF * } > W { \token_if_eq_meaning:NNTF ' } > W { \token_if_digit:NTF } > } > { \tl_show:n { #1 | #2 | #3 | #4 } } > > would declare \X to first grab tokens as long as they are equal in > meaning to *, then grab tokens as long as they are equal in meaning to > ', and finally grab digit tokens. > > Do you think that it would be useful to add yet another argument type > for that? (In the code I have now, I decided that the argument > grabbing would stop at the first { or space or }, or implicit such > token.) I have to say my initial reaction is 'not keen'. While xparse is a 'glue' layer between LaTeX2e and LaTeX3, and may not make it to a LaTeX3 format, I think we don't want to encourage irregular input if we can avoid it. Do we _really_ want to suggest that this may even be considered as a good idea for a new format? On the other hand, I guess it does fall within the 'parsing' remit of xparse, and may be something that is occasionally useful. I'd like to see a real use case, I guess. Joseph