|
|
||
|
Mike Pall pointed out to me that the Lua 5.1 compiler started to use constant folding optimizations at some point in its development lifetime, which had somehow escaped me previously.
Thanks to the Lua authors for that; e.g. now I can write stuff like degrees-to-radians conversion in a more obvious way, at least, without fear of wasting VM instructions. :)
local a = a+1+2
since it is parsed as:
local a = (a+1)+2
-- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia