Roughly: (1 + _ENV.B) should generate the following code, when '1' and 'B' do not fit as immediate operands: 7 - LOADK 0 5 -- R0 = "B" 8 - LOADK 1 6 -- R1 = 1 9 - GETTABUP 0 0 0 -- R0 = _ENV[R0] 10 - ADD 0 1 0 -- R0 = R1 + R0