[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [FUN] A bit of code golfing
- From: Martin <eden_martin_fuhrspam@...>
- Date: Sat, 1 Oct 2016 17:14:11 -0700
On 16-09-30 01:38 PM, Egor Skriptunoff wrote:
> Unlike the "string" library, "table" library DOES NOT have the
> possibility to use negative indexes for counting backwards from the end
> of a table.
By the way I can't find reason why not implement that semantic trick
with negative index for sequence functions.
I think it will be harmless and useful (at least for me, as I don't like
to remember which element table.remove() removes by default and prefer
to write
table.remove(some_table_name.subtable, -1)
instead of
table.remove(some_table_name.subtable, #some_table_name.subtable)
)