|
Olivier Hamel wrote:
Note that it's not permitted to do: enum "Test" { "Div", "Multi", "Add", "Sub", "Assign", "Call" }
Gah! I'm an idiot, Sorry! Here: function enum(strEnumSetName, tblEnumList) typecheck(strEnumSetName, "string") typecheck(tblEnumList, "table") return function() for k, v in ipairs(tblEnumList) do HackEnumCntr = HackEnumCntr + 1_G[k] = 2^HackEnumCntr -- Figure something for handling over overflows?
-- Is it even a possible concern? Never was in my experience... end end end Olivier