something like:
uses luaj-3anything without this line on the top will use the old/current system
Posted 03 March 2015 - 08:01 AM
uses luaj-3anything without this line on the top will use the old/current system
Posted 03 March 2015 - 02:55 PM
Lupus590, on 03 March 2015 - 08:01 AM, said:
uses luaj-3anything without this line on the top will use the old/current system
Edited by ElvishJerricco, 03 March 2015 - 02:57 PM.
Posted 03 March 2015 - 03:33 PM
Posted 03 March 2015 - 04:12 PM
CoderPuppy, on 03 March 2015 - 03:33 PM, said:
Edited by ElvishJerricco, 03 March 2015 - 04:13 PM.
Posted 03 March 2015 - 04:20 PM
Posted 03 March 2015 - 04:37 PM
CoderPuppy, on 03 March 2015 - 04:20 PM, said:
Edited by MKlegoman357, 03 March 2015 - 04:38 PM.
Posted 03 March 2015 - 04:45 PM
CoderPuppy, on 03 March 2015 - 04:20 PM, said:
local function createRecursiveEnv(parentEnv)
local new = {}
setmetatable(new, {__newindex=function(t,k,v)
if type(v) == "function" then
setfenv(v, createRecursiveEnv(new))
rawset(t, k, v)
end
end, __index = parent})
return new
end
local f = assert(loadfile("somefile.lua"))
setfenv(f, createRecursiveEnv({}))
f()
Edited by ElvishJerricco, 03 March 2015 - 04:48 PM.
Posted 03 March 2015 - 04:57 PM
Edited by RainbowDashDC, 03 March 2015 - 05:02 PM.
Posted 03 March 2015 - 05:02 PM
Edited by CoderPuppy, 03 March 2015 - 05:04 PM.
Posted 03 March 2015 - 05:04 PM
Posted 03 March 2015 - 05:11 PM
RainbowDashDC, on 03 March 2015 - 04:57 PM, said:
Posted 03 March 2015 - 05:13 PM
Lignum, on 03 March 2015 - 05:11 PM, said:
RainbowDashDC, on 03 March 2015 - 04:57 PM, said:
Posted 03 March 2015 - 05:29 PM
function setfenv(f, env)
return load(string.dump(f), nil, nil, env)
end
function foo()
herp(derp)
end
setfenv(foo, {herp = print, derp = "Hello, world!"})()
Posted 03 March 2015 - 06:12 PM
RainbowDashDC said:
function setfenv(f, env)
return load(string.dump(f), nil, nil, env)
end
function foo()
herp(derp)
end
setfenv(foo, {herp = print, derp = "Hello, world!"})()
Edited by ElvishJerricco, 03 March 2015 - 06:15 PM.
Posted 03 March 2015 - 06:15 PM
Posted 03 March 2015 - 08:49 PM
Edited by SquidDev, 03 March 2015 - 08:49 PM.
Posted 03 March 2015 - 09:09 PM
SquidDev, on 03 March 2015 - 08:49 PM, said:
Posted 03 March 2015 - 09:56 PM
RainbowDashDC, on 03 March 2015 - 09:09 PM, said:
SquidDev, on 03 March 2015 - 08:49 PM, said:
- for ( int i=0, j=off; i < n; i++ ) {
+ int j = off;
+ for ( int i=0; i < nchars; i++ ) {
...
+ return j - off;
Edited by SquidDev, 03 March 2015 - 09:58 PM.
Posted 03 March 2015 - 11:58 PM
Edited by RainbowDashDC, 03 March 2015 - 11:58 PM.
0 members, 3 guests, 0 anonymous users