lua-users home
lua-l archive

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


for a simple file test.lua:

a=1


run $ luac -l -l test.lua:

main <test.lua:0,0> (2 instructions at 0xbb83b0)
0+ params, 2 slots, 1 upvalue, 0 locals, 2 constants, 0 functions
1 [1] SETTABUP 0 -1 -2 ; _ENV "a" 1
2 [1] RETURN   0 1
constants (2) for 0xbb83b0:
1 "a"
2 1
locals (0) for 0xbb83b0:
upvalues (1) for 0xbb83b0:
0 _ENV 1 0


why print negative numbers -1 -2?
a little digging around luac.c reveals that it wraps the index with the macro MYK(..).

can anyone tell me why not just print INDEXK(..)  instead?