lua-users home
lua-l archive

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


On Thu, Mar 6, 2014 at 10:14 AM, Journeyer J. Joh
<oosaprogrammer@gmail.com> wrote:
> I want my module return a function.
> For my particular case, Is there any convenient function like module(...)?

Just something like this:

-- ftest.lua
return function(a)
  return {value = a}
end

then require 'ftest' will give you a function, which you can call.