lua-users home
lua-l archive

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



I've got the append and flatten functions done, they're fairly simple.

They actually deal with the tables as 'bags' or 'containers', meaning the
values of indices and/or their arrangement don't matter. Otherwise,
as you say, such functions wouldn't make sense.

-ak


jimmyp_gr kirjoittaa maanantaina, 14. huhtikuuta 2003, kello 18:55:

--- In lua-l@yahoogroups.com, Asko Kauppi <Asko.Kauppi@f...> wrote:

I'd also like 'table.append()' for appending numerically indexed
tables
together and 'table.flatten()' for removing any subtables (placing
their
items in main level).

But -as someone pointed out- there's probably so much variation in
needs
that it's best to leave these for each developer's hands.

table.flatten() might cause problems with name collisions as some
values inside 'deeper' tables might have the same keys etc. but isn't
there an append function? What does that table concat do? If that's
for generic(non vectorlike) tables then vector version(like iconcat)
might make sense and I doubt it would be hard to implement it.

Dimitris

PS:thanks for the code