LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sat, 8 Jan 2011 20:44:49 +0000
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=ISO-8859-1
From: Joseph Wright <[log in to unmask]>
Parts/Attachments: text/plain (31 lines)
On 08/01/2011 07:25, Bruno Le Floch wrote:
> PS: Also, a small crazy idea (I see no practical application for that):
> In LaTeX3, we can generate variants of macros with different types 
> of arguments (using \cs_generate_variant:Nn). Could/should the 
> same thing be done at the layer above? In other words, should it be 
> possible to take a DocumentCommand, and change the delimiters, or 
> change an argument from being optional to being mandatory, or from 
> being mandatory to being  optional with default, ...?

Not really. While the concept is still very much 'a work in progress',
in general it seems clear that as far as possible you should have

\NewDocumentCommand \foo { ... } {
  \internal_function:nnn ....

i.e. document commands should really not do much themselves, but should
pass data on to internal functions. Thus document commands define the
user syntax for some particular implementation, but for variants you'd do

\NewDocumentCommand \fooa { ... } {
  \internal_function:nnn ....
\NewDocumentCommand \foob { ... } {
  \internal_function:nnn +++

with different argument mappings.
Joseph Wright