lua-users home
lua-l archive

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

On Thu, Dec 24, 2009 at 7:42 AM, David Manura <> wrote:
>  table.imap(op'..', {'a','b'},{'1','2'})
>  tablex.map2(I(_1+_2),{1,2,3},{10,20,30})
> Isn't that sufficient?

Actually (upon mature reflection) I have to agree with you; this is
more explicit and there isn't any odd coupling. imap() really is meant
to be a very straightforward function (as in, explainable by a short

What's interesting is how much interpretation is possible with a
simple set of functions. Mark H would expect split() to return an
iterator, Yuri makes it return the unpacked values, etc. The latter is
easily enough done with string.gmatch, although the former is useful
enough to be given a new name (like splitv)

steve d.