lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: [ANN] Lua 5.3.0 (alpha) now available
From
: Daurnimator <quae@
...
>
Date
: Fri, 1 Aug 2014 11:53:02 -0400
On 1 August 2014 11:47, Patrick Donnelly
<
batrick@batbytes.com
>
wrote:
local function append (t, v)
return table.insert(t, #t, v)
end
In this case, why even use table.insert, just have `t[#t+1] = v`
You could also just use
local function append(t,v)
return table.insert(t, v)
end
==> now you'll never accidently pass 3 arguments to insert.
But now you've lost the speed advantage:
I recall table.insert was a tiny bit faster than doing it in lua, according to some benchmarks waqas did.
Follow-Ups
:
Re: [ANN] Lua 5.3.0 (alpha) now available
,
Patrick Donnelly
References
:
Re: [ANN] Lua 5.3.0 (alpha) now available
,
Roberto Ierusalimschy
Re: [ANN] Lua 5.3.0 (alpha) now available
,
Daurnimator
Re: [ANN] Lua 5.3.0 (alpha) now available
,
Jerome Vuarand
Re: [ANN] Lua 5.3.0 (alpha) now available
,
Dirk Laurie
Re: [ANN] Lua 5.3.0 (alpha) now available
,
Patrick Donnelly
Prev by Date:
Re: [ANN] Lua 5.3.0 (alpha) now available
Next by Date:
Re: Are automatic coercions ever going away?
Previous by thread:
Re: [ANN] Lua 5.3.0 (alpha) now available
Next by thread:
Re: [ANN] Lua 5.3.0 (alpha) now available
Index(es):
Date
Thread