[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Jill - Java Implementation of Lua Language.
- From: David Jones <drj@...>
- Date: Thu, 10 Dec 2009 16:09:33 +0000
2009/12/10 David Jones <drj@pobox.com>:
> 2009/12/10 Kristofer Karlsson <kristofer.karlsson@gmail.com>:
>> Also, your "next" implementation seems rather slow, iterating through a
>> table would take O(n^2) time it seems.
>
> Indeed. So don't do that then (the doc says this too!).
>
> The standard table iterator does not use next().
Just to be clear: Doing this: "for k,v in pairs(sometable) do ... end"
is efficient in Jill, and not at all O(n^2). Well actually this
depends on the underlying implementation of java.util.Hashtable, but
throw away any phone that has an inefficient keys() implementation.
drj