Created
August 24, 2017 07:01
-
-
Save nucleartide/e6c7514a6c46746681cafcc26d09527b to your computer and use it in GitHub Desktop.
ooh lua
This file contains 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
__luapack_modules__ = { | |
(function() | |
print('bar') | |
end), | |
(function() | |
print('foo') | |
end), | |
} | |
__luapack_cache__ = {} | |
__luapack_require__ = function(idx) | |
local cache = __luapack_cache__[idx] | |
if cache then | |
return cache | |
end | |
local module = __luapack_modules__[idx]() | |
__luapack_cache__[idx] = module | |
return module | |
end | |
__luapack_require__(1) | |
__luapack_require__(2) | |
print('hello world') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment