lua-users home
lua-l archive

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


On Wed, Jul 6, 2016 at 8:25 AM, steve donovan <steve.j.donovan@gmail.com> wrote:
> in place then the `n` field becomes an implementation detail. The
> table functions start respecting this, and nirvana is achieved.

Alas, but freedom from the wheel of death and rebirth is always harder
than it first seems.

The table returned from table.pack() now has a metatable (for __len)
and inevitably it will be passed to Lua code which doesn't respect
this. For example, pl.List will take a table (_assumed_ to be a
sequence) and slap its own metatable on it, rebranding it as a List
[0]. The carefully-crafted __len is lost in translation.

[0] the name is the result of initial Python-nostalgia, which has faded.