I didn't know where to put this, so it's going in general.
This isn't stated anywhere I saw, either on the wiki or the forums, and it's rather important info to know. multishell.launch() accepts an environment variable, like os.run(). However, unlike os.run(), setting the environment to getfenv(0) results in an instant 'loop in gettable' error (so descriptive!). This info should probably go somewhere (the wiki?), but I'm not sure where. Also, maybe a check in multishell itself might help? (if env == _G then error() end)
Don't put getfenv(0) as a tab's env!
Started by skwerlman, May 27 2014 07:14 AM
7 replies to this topic
#1
Posted 27 May 2014 - 07:14 AM
#2
Posted 27 May 2014 - 07:26 AM
not completely sure how that's the case, multishell.launch uses os.run... how can you state that it breaks with one, but not the other...
#3
Posted 28 May 2014 - 05:21 AM
Actually, now that I go back through with simpler testing code, the issue doesn't exist. The weirdest part that the error in the more complex code (which is still occurring) is listed as happening at the second line of a valid block comment. So the issue is somewhere else, but I have no idea where...
Maybe its a CC bug... I'll see if I can't find enough info about it to actually warrant a report (as in what causes it, or even when it happens)
Maybe its a CC bug... I'll see if I can't find enough info about it to actually warrant a report (as in what causes it, or even when it happens)
#4
Posted 28 May 2014 - 05:56 AM
how about you post your code, there's a 98% chance its not a CC bug.
#5
Posted 28 May 2014 - 07:04 AM
theoriginalbit, on 28 May 2014 - 05:56 AM, said:
how about you post your code, there's a 98% chance its not a CC bug.
#6
Posted 28 May 2014 - 07:20 PM
"loop in gettable" ocurrs when a table metadata __index refers to the table itself in any way. If LuaJ wouldn't detect this, you would be stuck in an infinite loop. Example:
I think you may have set some invalid __index to your environment.
I don't think its a LuaJ or CC bug.
local t1 = {}
local t2 = {}
setmetatable(t1, {__index = t2})
setmetatable(t2, {__index = t1})
t1["something"] -- will cause the "loop in gettable" error
I think you may have set some invalid __index to your environment.
I don't think its a LuaJ or CC bug.
#7
Posted 29 May 2014 - 06:53 AM
ardera, on 28 May 2014 - 07:20 PM, said:
I think you may have set some invalid __index to your environment.
I'm setting the environment of a program to 0 (_G), so unless that's invalid, there shouldn't be an issue.
#8
Posted 29 May 2014 - 06:57 AM
skwerlman, on 29 May 2014 - 06:53 AM, said:
ardera, on 28 May 2014 - 07:20 PM, said:
I think you may have set some invalid __index to your environment.
I'm setting the environment of a program to 0 (_G), so unless that's invalid, there shouldn't be an issue.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











