Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Thu, 6 Aug 2009 09:32:43 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n767Wg9S024077 for ; Thu, 6 Aug 2009 09:32:42 +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 n767QBjH006262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Aug 2009 09:26:12 +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 n75M1s2X001169; Thu, 6 Aug 2009 09:26:06 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 286177 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 6 Aug 2009 09:26:06 +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 n767Q6wJ012631 for ; Thu, 6 Aug 2009 09:26:06 +0200 Received: from ueamailgate02.uea.ac.uk (ueamailgate02.uea.ac.uk [139.222.131.185]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id n767PoSx030553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 6 Aug 2009 09:25:54 +0200 Received: from ueams02.uea.ac.uk (ueams02.uea.ac.uk [139.222.131.131]) by ueamailgate02.uea.ac.uk (8.13.1/8.13.1) with ESMTP id n767PoN7015982 for ; Thu, 6 Aug 2009 08:25:50 +0100 Received: from [139.222.114.191] by ueams02.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1MYxM9-00073V-VZ for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 06 Aug 2009 08:25:45 +0100 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 References: <4A7921CF.5020803@morningstar2.co.uk> <4A7A1505.4040604@residenset.net> <4A7A726F.3080006@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Canit-CHI2: 0.00 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, outgoing) X-CanItPRO-Stream: UEA:outgoing (inherits from UEA:default,base:default) X-Canit-Stats-ID: 27602533 - cbe0f7bfc909 X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 X-Scanned-By: CanIt (www . roaringpenguin . com) on 139.222.131.185 Message-ID: <4A7A857F.4010400@morningstar2.co.uk> Date: Thu, 6 Aug 2009 08:25:51 +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: <4A7A726F.3080006@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 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 06 Aug 2009 07:32:43.0306 (UTC) FILETIME=[15E290A0:01CA1668] Status: R X-Status: X-Keywords: X-UID: 5825 Joseph Wright wrote: > Will is on the nail here. The advantage of two different letters for > optional argument and optional argument + default is that it avoids this > question. Perhaps that scheme is better over all, even though we then > need an extra letter. How about: > > - n = optional argument with no default > - o = optional argument with default (which must therefore be specified) > - b = optional braced argument (as Will wanted "n" for this) Suggestion (2): - o = standard optional LaTeX argument with no default value. - d = delimited optional argument where both the delimiters and default must be given. - b or n = optional braced argument (now have a choice!). This means that "o" is a shortcut for "d[]{\NoValue}", and that any other case is handled "in full" using d. This seems like a reasonable balance between making simple optional arguments easy and having a consistent syntax: \DeclareDocumentCommand \foo { o m } { } \DeclareDocumentCommand \foo { d[]{Stuff} m } { } \DeclareDocumentCommand \foo { d(){0,0} m } { } % Optional co-ordinates Alternatively, the order could be reversed for d: \DeclareDocumentCommand \foo { d[{\NoValue}] m } { } which looks more like the current \newcommand syntax, but would need braces around the second argument (I don't like this idea, hence d currently doesn't work this way!). (By the way, xparse-alt currently uses "-NoValue-" rather than \NoValue, but I think this was a mistake: once the discussion is complete-ish and I know what is needed, I'll go back and change this.) -- Joseph Wright