lua-users home
lua-l archive

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


2018-03-28 9:35 GMT+02:00 pocomane <pocomane_7a@pocomane.com>:

> If # for table is removed, I probably will re-implement it by myself.
> The point is: I often found the current # behaviour very useful, not
> something to fight against. E.g. I can write `t[1+#t]=x` and be sure
> that the `x` is added in a free space!

I have often wished that table.border was available so that I could
use it to protect myself against __len metamethods.

I don't see the point of first class arrays whose elements are general
Lua values. You don't get enough extra speed. It optimizes at the
wrong place.

I do see the point of arrays of bytes, or two-byte Unicode characters,
or of floating-point numbers, etc, but those would be userdata, not
tables. Using the same method names as the string and/or table
libraries would of course be a sensible thing to do.