Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 Aug 2009 18:57:35 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n7AGvbwV022974 for ; Mon, 10 Aug 2009 18:57:37 +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 n7AGrl7F030169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Aug 2009 18:53:47 +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 n7AG7smD014993; Mon, 10 Aug 2009 18:53:45 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 299057 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 10 Aug 2009 18:53:45 +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 n7AGrjv5018176 for ; Mon, 10 Aug 2009 18:53:45 +0200 Received: from mordell.elzevir.fr (mordell.elzevir.fr [92.243.3.74]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n7AGraQA029615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 10 Aug 2009 18:53:40 +0200 Received: from roth.elzevir.fr (thue.elzevir.fr [88.165.216.11]) by mordell.elzevir.fr (Postfix) with ESMTPS id 5FBF435ECB for ; Mon, 10 Aug 2009 18:53:36 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by roth.elzevir.fr (Postfix) with ESMTP id 6AA6BBFEB for ; Mon, 10 Aug 2009 18:53:35 +0200 (CEST) User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 References: <4A7921CF.5020803@morningstar2.co.uk> <4A7A1505.4040604@residenset.net> <4A7AD930.2090106@residenset.net> <8516B615-51AA-4D90-BB7D-A9E122AA0335@gmail.com> <4A804317.6050909@morningstar2.co.uk> X-Enigmail-Version: 0.95.0 OpenPGP: url=http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x50A89B42 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <4A80508F.3030904@elzevir.fr> Date: Mon, 10 Aug 2009 18:53:35 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: =?ISO-8859-1?Q?Manuel_P=E9gouri=E9-Gonnard?= Subject: Re: xparse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <4A804317.6050909@morningstar2.co.uk> 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 16:57:36.0016 (UTC) FILETIME=[A92AB100:01CA19DB] Status: R X-Status: X-Keywords: X-UID: 5865 Joseph Wright a écrit : >> Just to confirm -- have I got this thing sort of right? :) >> For the sake of the discussion, I'll assume you got it right, but I'd also like a confirmation myself. >> With this sort of example, it seems pretty clear that this can save a >> lot of code that's just shuffling arguments around. (In the same way >> that manual optional argument processing consists of lots of >> intermediate functions that simply pass their arguments around.) > I agree. And it makes such a feature totally fit with the goal of xparse: allowing the macro writer to go straight to the point without worrying too much about user syntax. > That was my understanding also. The question is then whether we > want/need to support this for all argument types or just one (or more) > specific ones (or of course at all). > I think that if you want to support this in xparse then it should be accessible for all argument types. In my opinion, argument parsing and argument preprocessing are orthogonal things, and the syntax should reflect this orthogonality. Besides, if you start offering preprocessing for one argument type, soon you'll find out that someone needs it for another type, and either you will create new type to fill the gaps, or you will see a collection of packages offering partial solutions to the problem (a bit like in LaTeX2e you see a lot of partial approaches for multiple optional arguments). As a user/programmer, I expect the l3 tools to solve problems in a uniform and rational way, thought not necessarily exhaustive. > In the first case, the interface currently used by xparse doesn't really > work (I think). You need to go with something like xdoc2l3, where each > specifier has a "processing" argument. My worry with that is, as I've > said before, that it may be overly complex as a replacement for \newcommand. > Couldn't this processing argument be optional? If we go with the proposal of - o (optional argument without default value) - O{default} then the processing argument would be the only optional argument to all specifiers, so this shouldn't cause any confusion. This should be a way of preserving the simplicity of xparse (basic) syntax while offering part of the power of xdoc2l3. > The question is then how many types of argument need post-processing. IMO, all. I can't see a rational reason for authors to process only mandatory arguments. > If > it is only m => p, then this looks okay. Duplicating all of the > specifiers, one for post-processed and one not, takes us back to needing > to fundamentally re-think the plan. If I'm not mistaken, currently the plan is to allow a '+' modifier in front of every specifier in order to allow for \par in the argument. Maybe it is possible to add another modifier for preprocessing. This, or making the preprocessing macro an optional argument to every specifier, doesn't seem to make the syntax overly complicated. Of course it is always hard to find the right balance between simplicity and features, but in this case my personal preference would be to have it included. Manuel.