lua-users home
lua-l archive

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


>I know I can do the above, but I don't want the extra bit of variable look
>up and math on each call... I want "base + x" to be resolved at compile time
>into a number constant.

Aren't you prematurely optimizing?

>And then have lua compile that, is the compile process smart enough to
>collapse the contant math into a single contant: such as

No. The code generator does not currently do constant folding.
--lhf