6 ms·
[ANN] Lua 5.2.0 (final) now available
- rlbaker 15y agoAny links to info on 5.1.4 -> 5.2 changes? I can't seem to find any. EDIT: Found some information! http://www.corsix.org/content/look-lua-52-work3 http://www.corsix.org/content/look-lua-52-work3
- groovy2shoes 15y agoThere's some info in refman: http://www.lua.org/manual/5.2/manual.html#8 http://www.lua.org/manual/5.2/manual.html#8 There was a more detailed summary at http://www.lua.org/work/doc/#changes http://www.lua.org/work/doc/#changes but it looks like it's been taken down. There's the Google cache: http://tinyurl.com/832f273 http://tinyurl.com/832f273
- rlbaker 15y agoAh, thanks! These are much more informative.
- Avshalom 15y agoSo now that module(...) is deprecated does anyone know the expected standard pattern? The changes say to just build it with code (setting _ENV?) but do the devs have a "right way" to do it?
- LeafStorm 15y agoThe Lua developers are generally not very fond of endorsing a single "right way" to do things. But basically, it's something like: -- localize all the stuff you need local _ENV = {} -- module code return _ENV So really not that much code to add yourself.
- compay 15y agoAn easy way is to just define your functions in a table, and at the end of the file to be required, return the table. This was the pattern used in Lua before 5.1. The source for Luacov provides a clear example: https://github.com/keplerproject/luacov/blob/master/src/luacov.lua https://github.com/keplerproject/luacov/blob/master/src/luac...
- dmpk2k 15y agoIn the same vein, LuaJIT2 beta 9 was released a couple days ago.
- anonymoushn 15y agoIt's a bit weird that they went with goto. It is a much smaller addition than continue + labeled break + labeled continue + switch, but it's still really unusual to see in a scripting language.