LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show HTML 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:
Bruno Le Floch <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 18 Mar 2011 09:46:23 -0400
Content-Type:
text/plain
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
\use_i_ii:nnn.

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

Regards,
-- Bruno

ATOM RSS1 RSS2