lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Mar 9, 2010 at 11:49 AM, spir <> wrote:
> I recently had the idea sequence and string find* methods may be designed as higher-order functions (like map, filter, reduce). Eg
>   sequence:findall(assertionfunc)
> Just a kind of generalisation. This by the way makes findall and filter synonyms! ;-)
> What do you think?

There's a question of naming. For strings, string.gmatch is basically
findall, except driven by a pattern. They all return sequences.

Now Penlight already does have higher-order functions on sequences, so
what is the question again, given that they are synonyms?

steve d.