LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 29 Apr 2013 09:54:20 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
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

ATOM RSS1 RSS2