lua-users home
lua-l archive

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


2016-07-16 16:07 GMT+02:00 Philipp Janda <siffiejoe@gmx.net>:
consistencies.

> Anyway, I've decided to sidestep the issue and use `.n`-style tables for
> arrays in my own code. I've linked to the modified standard table library
> else-thread, and I've started to rewrite my other module code to always set
> `.n` on new arrays, and to check for `.n` before falling back to `#` or
> `luaL_len`. It's mostly compatible with Lua's sequences as long as no holes
> are involved, and I don't have to wait for Lua to figure things out ...

I have a library that uses a .shape field, which is a vector of numbers, e.g
a scalar stored as a table has shape {}, a 1-element vector has shaoe {1},
a 1x1 matrix has shape{1,1} etc.