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: Fri, 18 Mar 2011 09:46:23 -0400
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Message-ID: <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=ISO-8859-1
From: Bruno Le Floch <[log in to unmask]>
Parts/Attachments: text/plain (48 lines)
Sorry Lars,

I got your surname completely wrong in my previous email. (not sure
why that happened)

>> a constructed function name ie "c" though that is something you would
>> seldom need I guess.
> And it would be covered by applying a suitable \exp_args:... to the
> ..._map_function:... call, would it not?

The simplest would be
\cs_set_eq:NN \..._map_function:NN \..._map_function:Nn
\cs_generate_variant:Nn \..._map_function:NN {Nc}

>    ...map_function:Nn \l_foo_seq { \func:nn{foo} }
> rather do
>    \cs_new:Npn \map_func:n #1 { \func:nn{foo}{#1} }
>    ...map_function:NN \l_foo_seq \map_func:n
> ? The downside of this is that it hardwires the "foo" into a function
> body, when in practice it might be data that changes from call to call.
> You can of course redefine \map_func:n before every use, but it feels
> unelegant.

In the current implementation, if expandability is not an issue,
prefer map_inline, as it does not require any test for termination.

\seq_map_inline:Nn \l_foo_seq { \func:nn {foo} {#1} }

But if you need expandability, then map_function is required.

>    \cs_new:Npn \exch_args:Nnnn #1 #2 #3 #4 { #1{#2}{#4}{#3} }

I'd personally call it \use_i_bii_biv_biii:nnnn, where "b" means
"braced". This is more extensible, and fits with the current

> but \exch_args:Nnnn is more elegant, since it can be reused in more places.

-- Bruno