lua-users home
lua-l archive

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


Am 01.07.2016 um 11:03 schröbte Peter Melnichenko:
On Fri, Jul 1, 2016 at 7:09 AM, Philipp Janda <siffiejoe@gmx.net> wrote:
There are few smaller steps we can make:

*  Solve the `pack()`/`unpack()` symmetry problem.
*  Enhance the table library to allow non-sequence based array
implementations by adding a library metamethod `__resize` or `__setsize`, so
that `table.insert()` and `table.remove()` can adjust the array sizes
accordingly (`table.move()` is more complicated).

Does the second point mean I'll have to check for the new metamethod and
call it whenever I modify array part of a table passed to me from outside?

If you add or remove elements from that table (without using `table.insert()`/`table.remove()`) and you want to support non-sequence arrays, then yes. The main point however is that `table.insert()` and `table.remove()` can work correctly for alternative array implementations.


-- Peter


Philipp