lua-users home
lua-l archive

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



I was just in process of describing exactly the same idea as this message came in.

Exactly ... instead of mixing things in one table and then cope with separating them again, it is a much better idea not to mix them in first place.

It is generally *always a good idea* to ask *WHY* something is necessary, including a much more broad context to see the whole instead of the detail.


On 10/22/23 13:14, bil til wrote:
Am So., 22. Okt. 2023 um 12:09 Uhr schrieb Hans van der Meer
<havdmeer@ziggo.nl>:
But why isn't there a kpairs() for the record keys? I think it would make some programs easier, especially where the >relevant pairs() function is passed to another function.
if you request something like this, it might be interesting to know
WHY you are especially interested in this.

This would be mainly useful in a table with VERY many indices, but
only few further records... but in such case you could also could
consider to spend a further table just for the "further records"
(sometimes it is NOT so nice to cook all in one bowl :) ).