[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: t[] = 'syntactic sugar'
- From: Leo Razoumov <slonik.az@...>
- Date: Thu, 19 Jan 2012 07:36:28 -0500
On Thu, Jan 19, 2012 at 06:58, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
> I'm breaking a New Year's resolution … oh well it lasted 19 days …
> "Don't pour cold water on cute suggestions to improve Lua" …
>
> append = table.insert -- I do this anyway in just about every program I write
> ...
> append(my_long_descriptive_table_name,val)
t[#t+1] is more efficient. It directly translates into SETTABLE opcode
while append goes through a function call first.
--Leo--