Hallo,

On 3/13/07, Bruce Stephens <[EMAIL PROTECTED]> wrote:

Except that tables in Lua count from 1, not 0.  I don't know
why---seems an odd choice to me.  (And IIUC, it's by convention of the
various functions like ipairs, etc., not something more fundamental.)


    Since you can use almost anything as a table key (the exception
being nil), the choice of the first "natural" numeric key had to be
arbitrary. There is nothing odd to it, 1 is as good a choice as 0. And
ipairs is faster than pairs, because it uses only the array part of a
table (tables in Lua are composed of an array part and a hash part, so
integer-indexed tables are almost as fast as C arrays). So it would be
better to just use Lua as it's supposed to be.

Cheers,
--
-alex
http://www.ventonegro.org/


_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to