Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 Aug 2009 21:51:52 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n7AJpsIV029023 for ; Mon, 10 Aug 2009 21:51:54 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n7AJlV1q011000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Aug 2009 21:47:31 +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 n7AG7s4V014993; Mon, 10 Aug 2009 21:47:30 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 300008 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 10 Aug 2009 21:47:30 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id n7AJlUej031732 for ; Mon, 10 Aug 2009 21:47:30 +0200 Received: from anchor-post-1.mail.demon.net (anchor-post-1.mail.demon.net [195.173.77.132]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n7AJlGll010605 for ; Mon, 10 Aug 2009 21:47:20 +0200 Received: from cremornelane.demon.co.uk ([80.177.25.195] helo=[192.168.0.2]) by anchor-post-1.mail.demon.net with esmtp (Exim 4.69) id 1Maapw-0000sm-hl for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 10 Aug 2009 19:47:16 +0000 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 References: <4A7921CF.5020803@morningstar2.co.uk> <4A8072A6.9080005@elzevir.fr> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <4A807946.5060707@morningstar2.co.uk> Date: Mon, 10 Aug 2009 20:47:18 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: xparse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <4A8072A6.9080005@elzevir.fr> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -6.599 () BAYES_00,RCVD_IN_DNSWL_MED X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 10 Aug 2009 19:51:52.0648 (UTC) FILETIME=[01CE1C80:01CA19F4] Status: R X-Status: X-Keywords: X-UID: 5867 Manuel Pégourié-Gonnard wrote: > I'd like to ask about one point, that was maybe discussed earlier: if so, please > excuse me for not reading the archives first. I don't recall it coming up in any of the xparse discussions I've read :-) > Some argument specifiers imply peeking at the next token, using > \peek_meaning_remove:NTF (or maybe charcode in the future, but anyway the > unexpandable \peek_token_remove_generic_NTF at some point). > > The point is that peeking doesn't work purely by expansion, and it will > sometimes cause problems. A not-so-unfrequently-asked-question is about command > with an optional argument trying to call \multicolumn in a table, ending with > "misplaced \omit" error. > > In the 2e world, people have proposed variants of \@ifnextchar "working" purely > by expansion: there is at least xoptarg by Josselin Noirel and more recently > \FE@testopt and \FE@ifstar in Florent Chevret's etextools. Of course those are > not perfect and have their limitations, but those packages probably show there > is an interest for such tests. (I've been using xoptarg in a few personal macros > myself, and already considered implementing similar functionnality in xargs (but > didn't have to come to a decision, since I'm not working on xargs atm)). > > So, my question is: do you think it's worth proposing such a feature in xparse? > Of course it would be optional (eg, accessed using a modifier before the > argument specifier invloving peeking ahead) and the limitations of this approach > should be properly documented (unlike xoptarg). > > It would be quite a relief for authors wanting to define their personal macros > to be used in tabs, but not wanting (or even able to) handle all the > testing/argument-shuffling involved in writing the argument parser themselves. Remember, though, that *everything* xparse makes is \protected. So a function created with xparse will be trying to do \peek_ in an expansion situation. -- Joseph Wright