lua-users home
lua-l archive

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


On Mon, Dec 17, 2012 at 11:05 PM, Vadim Peretokin <vperetokin@gmail.com> wrote:
> I don't quite agree with the 'use Arrays if you want to use MLs table
> functions' idea, sorry. Why force the user to do that? I'm actually quite
> fond of some of the table functions, and don't use ML Arrays personally at
> all.

I think I'm with Vadim on this one; not all tables are Arrays, and the
'number of slots' is not a hard-and-fast criterion. After all, there's
very little code duplication since Array mostly wraps the table
functions. The issues Dirk mentions seem manageable with sufficient
documentation, e.g free-standing imap but Array.map, etc.

Of course, Array.map can be used with any suitable table as an
argument, but has to return an Array, unless we implement covariance
(that is, type A -> map -> type A)

steve d.