Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r3TIrWFp005480 for ; Mon, 29 Apr 2013 20:53:33 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx005) with ESMTP (Nemesis) id 0LjLO3-1V2O8Q2seN-00dShj for ; Mon, 29 Apr 2013 20:53:26 +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 r3TIoYV0029818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Apr 2013 20:50:34 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r3TDaF5S032355; Mon, 29 Apr 2013 20:50:34 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 9203045 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 29 Apr 2013 20:50:34 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r3TIoXDZ023497 for ; Mon, 29 Apr 2013 20:50:33 +0200 Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r3TIoAaV027460 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Mon, 29 Apr 2013 20:50:14 +0200 Received: by mail-pd0-f170.google.com with SMTP id 15so772225pdi.29 for ; Mon, 29 Apr 2013 11:50:10 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.75.98 with SMTP id b2mr46476827paw.112.1367261410231; Mon, 29 Apr 2013 11:50:10 -0700 (PDT) Received: by 10.66.149.101 with HTTP; Mon, 29 Apr 2013 11:50:10 -0700 (PDT) References: <517E353C.5050701@morningstar2.co.uk> Content-Type: multipart/alternative; boundary=f46d042fdb7aac0b4d04db845a53 Message-ID: Date: Mon, 29 Apr 2013 11:50:10 -0700 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: scott heard Subject: Re: Behaviour of \SplitArgument with missing input To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <517E353C.5050701@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:hU9RnhbkhoQ=:Vy0ShXWhmpiaGUuv6YRDpU 5nGE6sgtao4OnRc/WGC30B1Kjmy+9B5dSKR48RpvoWngXQEDQTKqeJgf836Jl0Fu1lc88II ofVvJBl0Vp2y5hokjxv3XZMT1bKzF83o0mbd1rDYMPxWoK9W2Is5Qq9lJFK1WBbZxcmfBN5 StGfft1C6tp6i7Efe5YAXQ7X7+qcHN+Aq7cw3XXgJylC0D0mYTbP7IKoOZ2mQOvwIYpqVgi +qJy338N8P7SiTwxN8z+68KNL0GYKkk08Br4aoc+vbx8kL2OJTcm8IuxMlQD8eZa4S10Npy XQZPUjJ36KLJyg6QxzReOY0lVL+gic+0FRRefZPw6dAC9OlwK9xYprkg204xfaGh6Io3FBT rC8cH7y0YASivVqt/4qT/U5NeCoWJbzR5hjNm9Nx62M9IX8SRgyhmb2qoJV4dnRAyYQPI3+ 5C0BrOUkieu2oT2IjlJD0w1HGxJ61ioxWXuMSQjb2K7Edc8bDmLVxKPajC8pVvzNO0b+WU/ oksJe7eRCe9vVO4Id0w2zjW6R0Inqhi7vMdKyAmOxEJL92+NM5z8paDNagmoySjrB6cXhAQ QICQTrA/PHdp2ZFJj9TIhEBj5lW7Wm02XyE3T/q6rtiUF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46d042fdb7aac0b4d04db845a53 Content-Type: text/plain; charset=ISO-8859-1 Hello, forgive (and correct) me if I misunderstand how this command should be used: \DeclareDocumentCommand { \foo } { > { \SplitArgument { 2 } { ; } } m } { \my_command:nnn #1 } As the output of '\SplitArgument' is some number of brace groups lumped together into a '#1', it seems like a test for '-NoValue' would need to be moved into '\my_command:nnn', i.e. from the xparse interface, into "programmer code". As `\IfNoValueTF' is an xparse command, that doesn't feel correct. If this is a reasonable interpretation/usage, then my personal opinion would be that empty brace groups (or something else) would be preferable to -NoValue-'s. scott On Mon, Apr 29, 2013 at 1:54 AM, Joseph Wright < joseph.wright@morningstar2.co.uk> wrote: > Hello all, > > I've had a couple of reports recently of an inconsistency in the way > \SplitArgument is documented compared to how it is implemented. In the > current CTAN release, something like > > \DeclareDocumentCommand { \foo } > { > { \SplitArgument { 2 } { ; } } m } > { \showtokens {#1} } > ... > \foo{bar} > > gives > > > {bar}{-NoValue-}{-NoValue-}. > \foo code #1->\showtokens {#1} > > i.e. inserts the '-NoValue-' marker, but the documentation says you > should get > > > {bar}{}{}. > \foo code #1->\showtokens {#1} > > i.e. empty groups. > > In the SVN, I have altered the behaviour to do what the docs say. > However, this breaks some packages and more importantly may not be the > 'best' approach. In particular, returning '-NoValue-' allows > differentiation of > > \foo{bar;;} and \foo{bar} > > which is not possible if an empty group is returned. > > Conceptually, '-NoValue-' was introduced for flagging omitted optional > arguments. Using it in \SplitArgument is therefore something of an > extension, but at the same time the way this function works makes the > splitting 'optional'. Thus it is quite arguable that the use of the > special marker is entirely correct here. > > What do people feel is the best approach? > > (Note: There are some other issues related to '-NoValue-' that this > raises, which I'll cover in a separate message.) > -- > Joseph Wright > --f46d042fdb7aac0b4d04db845a53 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello, forgive (and correct) me if I misunderstand how thi= s command should be used:

=A0 \DeclareDocumentCommand { \foo } =A0 =A0 { > = { \SplitArgument { 2 } { ; } } m }
=A0 =A0 { \my_command:nnn #1 }

As the output of '\SplitArgument' is some number = of brace groups lumped together into a '#1', it seems like a test f= or '-NoValue' would need to be moved into '\my_command:nnn'= , i.e. from the xparse interface, into "programmer code". =A0As `= \IfNoValueTF' is an xparse command, that doesn't feel correct. =A0I= f this is a reasonable interpretation/usage, then my personal opinion would= be that empty brace groups (or something else) would be preferable to -NoV= alue-'s.
scott

<= br>


On Mon, Apr 29, 2013 at 1:54 AM, Joseph Wright &l= t;jos= eph.wright@morningstar2.co.uk> wrote:
Hello all,

I've had a couple of reports recently of an inconsistency in the way \SplitArgument is documented compared to how it is implemented. In the
current CTAN release, something like

=A0 \DeclareDocumentCommand { \foo }
=A0 =A0 { > { \SplitArgument { 2 } { ; } } m }
=A0 =A0 { \showtokens {#1} }
=A0 ...
=A0 \foo{bar}

gives

=A0 =A0 > {bar}{-NoValue-}{-NoValue-}.
=A0 =A0 \foo code #1->\showtokens {#1}

i.e. inserts the '-NoValue-' marker, but the documentation says you=
should get

=A0 =A0 > {bar}{}{}.
=A0 =A0 \foo code #1->\showtokens {#1}

i.e. empty groups.

In the SVN, I have altered the behaviour to do what the docs say.
However, this breaks some packages and more importantly may not be the
'best' approach. In particular, returning '-NoValue-' allow= s
differentiation of

=A0 =A0\foo{bar;;} and \foo{bar}

which is not possible if an empty group is returned.

Conceptually, '-NoValue-' was introduced for flagging omitted optio= nal
arguments. Using it in \SplitArgument is therefore something of an
extension, but at the same time the way this function works makes the
splitting 'optional'. Thus it is quite arguable that the use of the=
special marker is entirely correct here.

What do people feel is the best approach?

(Note: There are some other issues related to '-NoValue-' that this=
raises, which I'll cover in a separate message.)
--
Joseph Wright

--f46d042fdb7aac0b4d04db845a53--