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 q650OUCe024381 for ; Thu, 5 Jul 2012 02:24:32 +0200 Received: (qmail 15217 invoked by alias); 5 Jul 2012 00:24:25 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 05 Jul 2012 00:24:25 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx061) with SMTP; 05 Jul 2012 02:24:25 +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 q650MXtM024683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Jul 2012 02:22:34 +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 q64M17gq028678; Thu, 5 Jul 2012 02:22:33 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1988782 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 5 Jul 2012 02:22:33 +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 q650MXvK006329 for ; Thu, 5 Jul 2012 02:22:33 +0200 Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q650LZhr024183 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 5 Jul 2012 02:22:32 +0200 Received: by vcbf13 with SMTP id f13so6791606vcb.22 for ; Wed, 04 Jul 2012 17:21:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.23.136 with SMTP id m8mr9525417vdf.28.1341447695246; Wed, 04 Jul 2012 17:21:35 -0700 (PDT) Received: by 10.220.166.75 with HTTP; Wed, 4 Jul 2012 17:21:34 -0700 (PDT) References: <201203031329.33709.pat_h@web.de> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Thu, 5 Jul 2012 02:21:34 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Feature proposal for \csNewDocumentCommand To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <201203031329.33709.pat_h@web.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (BackTrace mail analyze); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnGL2vqOgpaBYL16oitsMrgDt/NQNpSCZFFjDOy 97xb7Zpf+wZnd5ZXNcvLDXR3Wg3wRjdQbwEMh8=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: 7080 Hello Patrick, Sorry for the long delay in answering you. We had an internal discussion on your proposal some months ago, but somehow forgot to go back to you. The short answer is that we are most likely not to provide what you described. > Besides the great processing of a variable number of arguments via > \NewDocumentCommand it's very handy to define commands with a name defined > by some variable. Therefore I've been using the \csdef command from the > etoolbox package, which can handle the variable name, but lacks the simple > support for a variable amount of arguments. > > That's why I propose to have the combination of both worlds in the xparse > package. The usage would be like: > > \csNewDocumentCommand{}{}{} > > [...] > > I know, that xparse is for users and that there are other packages for > package authors. As I am a user and never created a package, I guess that > other users can make good use of the proposed command, too. So I had been > glad if I had found this functionality in the xparse package. Let me explain why we are not planning to add this functionality to xparse. [Not sure that my arguments will be as clear as I'd like them to be: it is starting to be a bit late in Europe.] One important aspect of xparse's DocumentCommand declarations is that they directly indicate the arguments that the function expects. If I open one of my colleague's document which includes some calls to \NewDocumentCommand, I can immediately know how each function behaves, at least at the level of the syntax: either the command is standard, or it is defined by his macros and I can look at the place where he defined it, to get an idea of what arguments the function expects. Now, this expectation of finding the definition of every document command easily is broken if we introduce \csNewDocumentCommand. Presumably, you are using it to define several commands with related names. The recommended way to do this is to write the \NewDocumentCommand declarations in full, calling some internal macros expressed using the expl3 code conventions. I can't construct a good example right now, but perhaps if you send me an example of where you would want to use \csNewDocumentCommand we can find a different approach to do it. In fact, even package writers should define all their document commands explicitly. For instance, we don't do \clist_map_inline:nn { New, Declare, Renew, Provide } { \exp_args:Nc \DeclareDocumentCommand { #1 DocumentEnvironment } { ... } { ... } } to define \NewDocumentEnvironment, \DeclareDocumentEnvironment, \RenewDocumentEnvironment, and \ProvideDocumentEnvironment in xparse. Instead, we declare each of those 4 functions individually, calling the appropriate internal macro. Does that make sense despite the time of the night? Best regards, Bruno