lua-users home
lua-l archive

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


Philippe:

On Mon, May 25, 2020 at 4:29 PM Philippe Verdy <verdyp@gmail.com> wrote:
> But there remains the common cases of indexes by numbers, which still require the [] in table constructors.
> Not all tables are constructed as sequences, writing t = {1, 2, 3, [10] = 100,} or t = {'a', 'b', 'c', [25] = 'y', 'z', [-1] = '',} is ugly
> It could simply be  t = {1, 2, 3, 10 = 100,}  or t = {'a', 'b', 'c', 25 = 'y', 'z', -1 = '',}
> Such use is not exceptional, it exists with sparse-indexed lookup tables (which are frequent in many projects). These brackets obscure the data making them unnecessarily long if this is a large table constructor with many keys.

I have no clue of what point you are trying to make here, or what you
are replying to.


> As well the way the tables are dumped in debugging consoles is ugly and verbose,

Mine does not do it.

.....
> "mw.logObject(t)" logs tables and subtables in Wikimedia, .....but a bad design of the mw package for this function,......

Seems you do not like that mw thingie. Why don't you just find another
one that better suits your tastes? Or write your own as I did?

Francisco Olarte