lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Mon, Jun 18, 2012 at 1:53 PM, Patrick Masotta <> 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.