lua-users home
lua-l archive

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


On Fri, Dec 18, 2009 at 1:16 PM, Fabien <fleutot+lua@gmail.com> wrote:
> In metalua there's an imap (it recycles the"i" of ipairs/pairs convention,
> to provide list-oriented and hash-oriented functors); it takes an arbitrary
> number of tables, and therefore supercedes map, map2, map3 etc.

This does sound interesting, I will check imap out.  Are there are any
efficiency compromises involved with an arbitrary number of tables?

By 'recycles the i of ipairs/pairs convention' do you mean that the
function is passed both the value and the key, in that order?  It's
certainly an ordering which allows for a good default.

> zip2 = |t1, t2| table.imap(|x,y| {x, y}, t1, t2)

Ah, such nice notation ... alas, it is not to be ;)

steve d.