Removing holes from a list
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Removing holes from a list
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2015年9月26日 16:59:43 +0200
For example:
list=table.pack(1,2,3,nil,4,5,nil,nil,6,7)
I have several ugly methods that work, e.g. operate
with two indices inside a while loop until one reaches
list.n, make a new table containing the non-nil entries
and assign it to `list`.
Does anyone have a method that deserves to be
called elegant?