Skip to content

Instantly share code, notes, and snippets.

@fur-q
Created October 10, 2012 01:19
Show Gist options
  • Save fur-q/3862572 to your computer and use it in GitHub Desktop.
Save fur-q/3862572 to your computer and use it in GitHub Desktop.
stop using module() ok
local mod = require "mod"
print(mod.func, mod.x)
-- 100, function: 0xFFFFFFFF
print(mod.priv, priv)
-- nil, nil
local function priv(x)
return x * 2
end
local mod = {
x = 100
}
function mod.func(x)
self.x = x
return priv(self.x)
end
return mod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment