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
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< 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]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
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.

-- 
www.mhelvens.net

ATOM RSS1 RSS2