[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LUA oddities..
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 18 Jun 2012 14:21:38 +0200
On Mon, Jun 18, 2012 at 1:53 PM, Patrick Masotta <masottaus@yahoo.com> wrote:
> >If you want an array, zero indexed or not, it is a pretty trivial
> > extension to write one
> again; yes and the performance penalty makes you consider probably
> Javascript would've been a better option...
Actually, in LuaJIT there isn't a performance penalty for zero-based
'arrays'. So you can write {[0]=1,2,3,4} and that will be full-speed.
However, the standard libraries assume 1..n arrays and would require
extensive patching. LuaJIT is definitely a case where confusion can
and does happen, because cdata is ... yep, zero-indexed.
steve d.