Some fun things,
MyObject = {}
function MyObject:load(...)
if event == "ADDON_LOADED" then
if arg[1] == "MyAddon" then
-- etc
end
end
end
function MyObject:init()
Frame = CreateFrame("Frame")
Frame:SetScript("OnEvent", bind(self, MyObject.load))
end
luafixes.lua
-- id()
myTable = {}
id(myTable) -- 27FC3608
-- table.prepend
table1 = {"foo", "bar"}
table2 = {"foobar"}
table.prepend(table1, table2) -- {"foo", "bar", "foobar"}
print.lua
-- print()
print("Foo: ", 42) -- Foo: 42
print("Foo: ", "Bar: ", 42) -- Foo: Bar: 42
print("Foo: ", table1) -- Foo: 27FC3608
Debug.lua
-- Debug:unpack()
function test(...)
print("arg: ", Debug:unpack(arg)) -- "arg: foo bar"
print("arg: ", Debug:unpack(arg, ", ")) -- "arg: foo, bar"
end
test("foo", "bar")
and more..