Neopallium/luvit — comment on commit a380973695f06d1027d3c8546437e63b4e53bcdf
File:  line 0
By creationix:

A more likely scenario is I implement a "securable modules" style API to allow for cyclic dependencies. I don't like this API, but it does make for quite elegant cyclic dependencies possible.

local exports = {}
local module = {exports=exports}
package.loaded[path] = exports
local env = getfenv(fn)
env.module = module
env.exports = exports
fn()