LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Michiel Helvensteijn <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Sat, 26 Oct 2013 15:00:47 +0200
text/plain (22 lines)
On Sat, Oct 26, 2013 at 4:32 AM, Donald Arseneau <[log in to unmask]> wrote:

>> But the functional programming concept doesn't really fit the expl3
>> concept, except for token lists.
> I'm not sure if the expl3 "map" is a straight "foreach" or a
> list accumulator.  There are several "*map*" definitions in
> expl3 internals.  The one you mean, Does it convert a list of
> x,y,z to a list of f(x),f(y),f(z)?  If so, it is a proper
> mapping operation.  Or does it just spit out f(x), f(y), and
> f(z) in turn?  Then it should just be "foreach".

Exactly. The expl3 map functions visit each element of a
data-structure in turn, apply the provided function, then leave the
result in the input stream. That's why I was thinking 'foreach' would
have been a better name. And indeed, the provided function doesn't
have to be pure or side-effect free. An expl3 mapping function is
really a looping construct.