[I might throw this one out. Scroll down for the orif idea]
Sometimes when you're coding you end up with things like this:
local track={} | |
setmetatable(track,{__mode="v"}) | |
function setmetatable52(t,mt) | |
if mt.__gc then | |
local p = newproxy(true) | |
track[p] = t | |
getmetatable(p).__gc = function(p) | |
local mt = debug.getmetatable(t) | |
if mt and rawget(mt, "__gc") then | |
rawget(mt, "__gc")(t) |
Hello,
I'd like to talk about abstract enums. In Java, you have enums:
public enum MyEnum {
MY_ENUM_VALUE,
MY_OTHER_ENUM_VALUE;
}
# This makefile is so we can extract some #define's from the C library, as LuaJIT has no way of exposing those #define's. | |
# Just run `make liolib.lua`. | |
LIOLIBC= int SEXIO_IOFBF = _IOFBF; \ | |
int SEXIO_IOLBF = _IOLBF; \ | |
int SEXIO_IONBF = _IONBF; \ | |
int SEXIO_SEEK_SET = SEEK_SET; \ | |
int SEXIO_SEEK_CUR = SEEK_CUR; \ | |
int SEXIO_SEEK_END = SEEK_END; |
MPNGPNG v0.22
Authors:
-- JIT It, the thing that makes LuaJIT JIT. | |
do | |
-- get the registry table | |
local registry = debug.getregistry(); | |
-- replace debug.getregistry with a JIT-able (pure-Lua) version. | |
debug.getregistry = function() return registry end | |
end |
--[[ pastebin didn't like me so I'm moving it here ]] | |
--[[ code used to make Shocky run this remote file | |
.r sonilua <lua>local function runpage(pageurl) local page,f,l; page = {net.get(pageurl)}; f=loadstring(page[1]); l = {}; for k,v in pairs(_G) do l[k] = v; end; for k,v in pairs(getfenv()) do l[k] = v; end; setfenv(f,l); return f(); end; return runpage("https://gist.githubusercontent.com/SoniEx2/f392c77ae81032bc295e/raw/sonilua.lua"); | |
--]] | |
--[[ | |
This is public domain btw | |
--]] | |
if (not args) or (args == "") then |