View Single Post
09-08-08, 02:04 PM   #27
kerrang
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2006
Posts: 109
Originally Posted by Mikord View Post
On the functions, yes it's better to create a "namespace" for your mod and define all publicly accessible functions/data as a part of it.

MyMod = {}
function MyMod.PubliclyAccessibleFunction(args...)
-or-
function MyMod:PubliclyAccessibleFunction(args...)

Event handlers however rarely need to be called outside of in response to an event and therefore can almost always by a completely local function like I demonstrated in the previous code.
I've noticed many authors use this approach now - what, exactly is bad about using global functions - or assigning functions into your Frame - or using entirely local functions?
  Reply With Quote