Subject: | |
From: | |
Reply To: | |
Date: | Sat, 8 Dec 2018 07:29:13 +0000 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On 07/12/2018 19:17, Kelly Smith wrote:
> Hello,
>
> I’ve seen mentioned here and there that the conditional functions in xparse
> are now considered inappropriate. I wanted to get some clarification about
> that. For example, if I have the command
>
> \NewDocumentCommand \foo { s m }
> {
> \IfBooleanTF { #1 }
> { \mymodule_foo_star:n { #2 } }
> { \mymodule_foo_nostar:n { #2 } }
> }
>
> is it now preferrable to define it as
>
> \NewDocumentCommand \foo { s m }
> { \mymodule_foo:nn { #1 } { #2 } }
>
> and have \mymodule_foo:nn do the conditional handling internally?
>
> Warmly,
> Kelly
>
Hi Kelly,
The idea of xparse remains the same: separating document syntax from
code/implementation. Most of the time, document-level switches will link
with different code-level interfaces. So I'd expect to see the
\IfBooleanTF approach in most cases. Of course, where there is a
code-level interface which takes a boolean, the second approach may be
useful, but less common.
Joseph
|
|
|