diff --git a/class.lua b/class.lua index 83567eb..21c5ff4 100644 --- a/class.lua +++ b/class.lua @@ -145,22 +145,15 @@ function package.inherit( base ) end end -------------------------------------------------------------------------------- --- setmodule() --- Purpose: Creates a module --- Input: name - Name of mdoule -------------------------------------------------------------------------------- -local function setmodule( name ) - module( name, package.class ) -end - ------------------------------------------------------------------------------- -- class() -- Purpose: Creates a class -- Input: name - Name of class ------------------------------------------------------------------------------- function class( name ) - setmodule( name ) + local function setmodule( name ) + module( name, package.class ) + end setmodule( name ) -- Make the class available to the environment from which it was defined local _M = package.loaded[ name ] setfenv( 2, _M )