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: Sat, 26 Oct 2013 15:00:47 +0200
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: Michiel Helvensteijn <[log in to unmask]>
Parts/Attachments: 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.