View Full Version : Inclusion of Lua 5.2? Bitwise Operators & Macros...

June 3rd, 2014, 01:48

I have just come across another feature that is missing in 5.1 that I wanted to use but couldn't - bitwise operators. It looks like Lua 5.2 (released in 2011) includes both macros and bitwise operators. Is there any plan to update Lua to 5.2 in the works?


Moon Wizard
June 3rd, 2014, 02:41
No current plans.

Lua 5.2 changes the way environments are used. and FG uses this extensively to accomplish what it does for the current API. It would require a re-implementation of the entire Lua FG object instantiation and environment handling (i.e. each window and control and database node has it's own object and environment). Without spending a fair amount of time prototyping, I'm not even sure if the current model would work in 5.2. I'm assuming it would eventually, but it's a big unknown development cost. If I could get the FG object model to work in the same way, I would still be concerned with unknown changes in 5.2 causing unforeseen challenges with the full spectrum of FG rulesets and extensions.

Given that, the benefits of upgrading to Lua 5.2 do not justify the costs at this point.


June 3rd, 2014, 03:54
All databases are corrupted, but bit32 works! :D

Whip that donkey pullin' the legacy wagon! :D

Thanks for the info. Oh well...It's a good argument for 5.1 add-ons, though! :D

June 4th, 2014, 07:19
On the bitwise operator front, I found some purely lua script libraries that implement bit functionality (like luabit), so if anyone wanted to use it, they could just include it as a script with the extension. Here is the list of options: http://lua-users.org/wiki/BitwiseOperators

Here is luabit, if anyone is interested: http://luaforge.net/projects/bit/ -- not all the files/code here is necessary - could be stripped down somewhat to include in an extension