title asks it all
EDIT: i only ask to know if i should plan for compatibility
is ComputerCraft ever going to update to Lua 5.2?
Started by tesla1889, Feb 08 2013 06:42 PM
9 replies to this topic
#1
Posted 08 February 2013 - 06:42 PM
#2
Posted 09 February 2013 - 01:33 AM
Doubt it. Would break a lot of programs.
#3
Posted 09 February 2013 - 07:05 AM
getfenv() and setfenv() were both removed in 5.2. For good reason, I hope.
#4
Posted 09 February 2013 - 12:40 PM
Kingdaro, on 09 February 2013 - 07:05 AM, said:
getfenv() and setfenv() were both removed in 5.2. For good reason, I hope.
there are work arounds for both of those involving the added _ENV table. i ask because i often find myself using those and i want compatibility
#5
Posted 09 February 2013 - 12:42 PM
ipairs was also removed in 5.2, Though there are alternatives. This would break many programs also.
#6
Posted 09 February 2013 - 12:50 PM
ipairs isn't removed, it's only deprecated.
I tried screwing around with _ENV, but could never fully figure it out. I'll look up a tutorial or something later on.
tesla1889, on 09 February 2013 - 12:40 PM, said:
there are work arounds for both of those involving the added _ENV table. i ask because i often find myself using those and i want compatibility
#7
Posted 09 February 2013 - 12:55 PM
_ENV is the environment table
a workaround for setfenv would be
a workaround for setfenv would be
setfenv = function(fn,env)
if (type(fn) ~= "function") or (type(env) ~= "table") then
error("invalid args")
end
env.main = fn
env.oldenv = _ENV
return function(...)
_ENV = env
local t = {main(...)}
_ENV = oldenv
return unpack(env.t)
end
end
#8
Posted 20 September 2013 - 03:42 AM
I need lua 5.2 for my scripts.
There is an implementation of {get,set}fenv for lua 5.2. https://github.com/d.../lua-compat-env
There is an implementation of {get,set}fenv for lua 5.2. https://github.com/d.../lua-compat-env
#9
Posted 20 September 2013 - 08:32 AM
It's not happening. Stop bringing it up.
#10
Posted 20 September 2013 - 12:10 PM
Also, I have no idea where the ipairs being removed/deprecated nonsense came from, since Lua 5.2 adds an __ipairs metamethod.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


This topic is locked









