Skip to content

Instantly share code, notes, and snippets.

@NimbusBP1729
Created October 28, 2012 20:35
Show Gist options
  • Save NimbusBP1729/3969822 to your computer and use it in GitHub Desktop.
Save NimbusBP1729/3969822 to your computer and use it in GitHub Desktop.
What we do...
--this is what we generally do
local Alpha = {}
Alpha.__index = Alpha
Alpha.alpha = true
--many lines of code later:
--to test a node's type:
if node.alpha then
--do something
end
--this is what we could do
local Alpha = {}
Alpha.__index = Alpha
Alpha.alpha = true
--many lines of code later:
--to test a node's type:
if node.__index==Alpha then
--do something
end
--this is what we should do
local Alpha = {}
Alpha.__index = Alpha
Alpha.isAlpha = true
--many lines of code later:
--to test a node's type:
if node.isAlpha then
--do something
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment