Created
June 9, 2022 17:39
-
-
Save DenisBelmondo/c018c1c1df7030d083f47b336e58ebff to your computer and use it in GitHub Desktop.
Lua C++ style classes syntax hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function class(name) | |
local penis = { | |
public = function(_, super_name) | |
return function(body) | |
print(body) | |
end | |
end | |
} | |
setmetatable(penis, { | |
__call = function(body) | |
print(body) | |
end | |
}) | |
return penis | |
end | |
-- these are syntactically correct statements: | |
class 'SuperClass' { | |
} | |
class 'SubClass' : public 'SuperClass' { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment