lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Dec 2, 2010 at 1:40 PM, Duncan Cross <duncan.cross@gmail.com> wrote:
>  ==== alternate sub/mod.lua #1 ====
>  module("sub.mod")
>  _VERSION="0.1"
>  function Function()
>     return "Result"
>  end

Wrap it in a function:

(function()
 module 'sub.mod'
 _VERSION = '0.1'
 function Function()
   return "Result"
 end
end)()

Untested, but it will probably work ;)

steve d.

PS. module() is old hat now, definitely I'd vote for the second suggestion.