Lua 5.2 in LÖVE 0.9.0

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
jpnk
Prole
Posts: 8
Joined: Mon Dec 24, 2012 2:12 pm

Lua 5.2 in LÖVE 0.9.0

Post by jpnk » Sat Jun 08, 2013 4:50 am

any chance to see that happen?

User avatar
slime
Solid Snayke
Posts: 2858
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Lua 5.2 in LÖVE 0.9.0

Post by slime » Sat Jun 08, 2013 4:57 am

Nope. Lua 5.2 has low adoption among tools and libraries and it's not backwards compatible with Lua 5.1 code in many cases - especially in its C API.
In particular, luasocket currently only supports Lua 5.1, and LuaJIT is fully compatible with Lua 5.1 (so can be used as a drop-in replacement), but not so with Lua 5.2.

User avatar
jpnk
Prole
Posts: 8
Joined: Mon Dec 24, 2012 2:12 pm

Re: Lua 5.2 in LÖVE 0.9.0

Post by jpnk » Sat Jun 08, 2013 5:13 am

thanks. i just bumped into an annoying bug that is fixed in 5.2. *sigh*

User avatar
slime
Solid Snayke
Posts: 2858
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Lua 5.2 in LÖVE 0.9.0

Post by slime » Sat Jun 08, 2013 5:14 am

What's the bug? Maybe it's fixed in LuaJIT as well.

User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Lua 5.2 in LÖVE 0.9.0

Post by Inny » Sat Jun 08, 2013 4:19 pm

The only notewhile feature we receive in lua5.2 is the _ENV table, which is cool and all, but we get along fine without it.

User avatar
jpnk
Prole
Posts: 8
Joined: Mon Dec 24, 2012 2:12 pm

Re: Lua 5.2 in LÖVE 0.9.0

Post by jpnk » Sat Jun 08, 2013 6:39 pm

slime wrote:What's the bug? Maybe it's fixed in LuaJIT as well.
'__len' metamethod isn't invoked on tables. so '#some_table' always returns the actual length of some_table and the metatable isn't checked.
Inny wrote:The only notewhile feature we receive in lua5.2 is the _ENV table, which is cool and all, but we get along fine without it.
in general i can't complain about lua5.1 either. my ride with it has been quite smooth... until yesterday:)

User avatar
markgo
Party member
Posts: 189
Joined: Sat Jan 05, 2013 12:21 am
Location: USA

Re: Lua 5.2 in LÖVE 0.9.0

Post by markgo » Sat Jun 08, 2013 6:46 pm

In 5.1, I'm pretty sure the __len metamethod only applies to userdata. So it would not be a bug. 5.1 should do you well anyways. Good luck.

User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Lua 5.2 in LÖVE 0.9.0

Post by Boolsheet » Sat Jun 08, 2013 7:09 pm

Indeed. That it works on tables too is new to 5.2. From http://www.lua.org/manual/5.2/readme.html#changes:
tables honor the __len metamethod
Shallow indentations.

User avatar
slime
Solid Snayke
Posts: 2858
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Lua 5.2 in LÖVE 0.9.0

Post by slime » Sat Jun 08, 2013 8:18 pm

if LuaJIT is built with "-DLUAJIT_ENABLE_LUA52COMPAT" then you get the __len metamethod on tables as well.

User avatar
jpnk
Prole
Posts: 8
Joined: Mon Dec 24, 2012 2:12 pm

Re: Lua 5.2 in LÖVE 0.9.0

Post by jpnk » Sat Jun 08, 2013 8:39 pm

slime wrote:if LuaJIT is built with "-DLUAJIT_ENABLE_LUA52COMPAT" then you get the __len metamethod on tables as well.
that should work for me. thanks a lot.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests