I know this is kind of lazy, and you could just loop over a table with "pairs" and collect all of the keys, but is there a built in function that will return a table of any given table's keys? If not, then I'll implement my own, but I don't want to waste tokens where unnecessary.
Cheers in advance!
P#90319 2021-04-10 11:38
I can see how that'd be useful, but it's niche enough that it hasn't (to my knowledge) been implemented in PICO-8's "cozy" little API.
(I think even in regular Lua there's no helper for that, but I could be wrong.)
I'd probably just do it manually, as you indicated yourself:
for k in pairs(a) do b[#b+1]=k end |
P#90321 2021-04-10 12:27
[Please log in to post a comment]