lua-users home
lua-l archive

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


> I am noticed that, in the debug output of luac,
> constants numbering starts at 1 whereas locals
> and upvalues numbering starts at 0.

No string reason except that some instructions accept either a register
or a constant and in the latter case the constant number is shown as
negative in the instruction listing. If constants started at 0 then we'd
get -0 in the listing and it'd look weird. Perhaps not.

I agree it's not very consistent but there it is. And it's been like that for
a long time...