Skip to content

Instantly share code, notes, and snippets.

@nucleartide
Created August 24, 2017 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucleartide/e6c7514a6c46746681cafcc26d09527b to your computer and use it in GitHub Desktop.
Save nucleartide/e6c7514a6c46746681cafcc26d09527b to your computer and use it in GitHub Desktop.
ooh lua
__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