HOWTO: Inter-plugin communication
#23
No, it cannot, mainly because functions in Lua are really closures - they take with them the local values of their containing functions and are able to modify those; this cannot be safely ported to another Lua state structure. Consider the following example:
function FnOuter(ParamOuter)
  local VarOuter = 10;
  local FnInner = function(ParamInner)
    local VarInner = VarOuter + 1;  -- It can read FnOuter\'s local variables
    VarOuter = VarOuter * 3;  -- It can modify them
    local VarInner2 = ParamOuter + 1;  -- It can even read FnOuter\'s parameters
  end
  SomeOtherFunction(FnInner);  -- Perfeclt valid Lua code, SomeOtherFunction() can call FnInner however it wants
end
Reply
Thanks given by:


Messages In This Thread
HOWTO: Inter-plugin communication - by FakeTruth - 10-11-2012, 08:07 AM
RE: HOWTO: Inter-plugin communication - by ThuGie - 10-11-2012, 08:11 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-11-2012, 09:08 PM
RE: HOWTO: Inter-plugin communication - by xoft - 10-11-2012, 11:05 PM
RE: HOWTO: Inter-plugin communication - by ThuGie - 10-12-2012, 12:36 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-12-2012, 04:57 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-23-2013, 05:43 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-23-2013, 06:33 AM
RE: HOWTO: Inter-plugin communication - by xoft - 11-25-2013, 01:33 AM
RE: HOWTO: Inter-plugin communication - by xoft - 12-07-2013, 06:51 AM



Users browsing this thread: 2 Guest(s)