lua-users home
lua-l archive

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


O.K.

So simple!

Thank you Steve Donovan!


----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m
----------------------------------------


2014-03-06 17:20 GMT+09:00 steve donovan <steve.j.donovan@gmail.com>:
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.