Thread: OO initiative.
View Single Post
11-28-05, 04:36 PM   #5
sacha
An Aku'mai Servant
 
sacha's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 38
Great thread - Im learning something today
BTW - Is there any advantage/disadvantage to using an approach as below?

Code:
local function somePrivateFunction()

end

local function somePrivateFunction2()

end

MyAddon = {

  somePublicVariable = value,
  somePublicVariable2 = value

};

MyAddon.somePublicFunction = function()
  -- may use a local function in here, or not
end


MyAddon.somePublicFunction2 = function()
  -- may use a local function in here, or not
end
Also I am not sure whats the significance of using "function MyAddOn:AnotherFunc()" as opposed to "MyAddon.somePublicFunction2 = function()" , I will read the lua docs again, but if anyone can explain it to me in simple terms Id appreciate it
  Reply With Quote