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: Mon, 15 Sep 2014 20:09:05 +1200
MIME-version: 1.0
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Content-type: text/plain; charset=ISO-8859-1; format=flowed
From: aparsloe <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Message-ID: <[log in to unmask]>
Content-transfer-encoding: 7bit
Parts/Attachments: text/plain (43 lines)
On 15/09/2014 7:22 p.m., Joseph Wright wrote:
> On 15/09/2014 05:55, aparsloe wrote:
>> I have found a number of instances where I have wanted to generate a
>> variant with varying degrees of branching, e.g.
>> \cs_generate_variant:Nn \tl_case:Nn { No }
>> \cs_generate_variant:Nn \tl_case:NnT { No }
>> \cs_generate_variant:Nn \tl_case:NnF { No }
>> I find myself envious of the functionality available with
>> \prg_new_conditional:Npnn and its ilk where multiple degrees of
>> branching can be coded in a single statement using a subset of { p, F,
>> T, TF }. It would be nice to be able to write something similar, e.g.
>> \cs_generate_variant:Nnn \tl_case:Nn { No } { , F, T }
>> where the empty slot before the first comma denotes the nonbranching
>> variant.
>> I don't imagine I'm the first to have thought this, so presumably there
>> is good (or at least some) reason for not providing the functionality.
>> It would be good to know.
>> Andrew
> I don't remember any technical reasons for not doing this: I guess
> primarily we've not needed it often enough.
> Probably this would go into \prg_... as it's only applicable to
> conditionals (we have \prg_new_eq_conditional:NNn and
> \prg_set_eq_conditional:NNn). I guess something like
> \prg_generate_conditional_variant:Nnn would be an appropriate name.
> Thoughts?
> --
> Joseph Wright
Correction: I meant to write

\cs_generate_variant:Nn \tl_case:Nn { o }

etc., expanding the token list variable.